chore: Soft delete webhooks (#3722)
This commit is contained in:
13
server/migrations/20220702132722-add-webhooks-deleted-at.js
Normal file
13
server/migrations/20220702132722-add-webhooks-deleted-at.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
up: async (queryInterface, Sequelize) => {
|
||||||
|
await queryInterface.addColumn("webhook_subscriptions", "deletedAt", {
|
||||||
|
type: Sequelize.DATE,
|
||||||
|
allowNull: true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
down: async () => {
|
||||||
|
await queryInterface.removeColumn("webhook_subscriptions", "deletedAt");
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
import { Event } from "@server/types";
|
import { Event } from "@server/types";
|
||||||
import Team from "./Team";
|
import Team from "./Team";
|
||||||
import User from "./User";
|
import User from "./User";
|
||||||
import IdModel from "./base/IdModel";
|
import ParanoidModel from "./base/ParanoidModel";
|
||||||
import Fix from "./decorators/Fix";
|
import Fix from "./decorators/Fix";
|
||||||
|
|
||||||
@Table({
|
@Table({
|
||||||
@@ -19,7 +19,7 @@ import Fix from "./decorators/Fix";
|
|||||||
modelName: "webhook_subscription",
|
modelName: "webhook_subscription",
|
||||||
})
|
})
|
||||||
@Fix
|
@Fix
|
||||||
class WebhookSubscription extends IdModel {
|
class WebhookSubscription extends ParanoidModel {
|
||||||
@NotEmpty
|
@NotEmpty
|
||||||
@Column
|
@Column
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user