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 Team from "./Team";
|
||||
import User from "./User";
|
||||
import IdModel from "./base/IdModel";
|
||||
import ParanoidModel from "./base/ParanoidModel";
|
||||
import Fix from "./decorators/Fix";
|
||||
|
||||
@Table({
|
||||
@@ -19,7 +19,7 @@ import Fix from "./decorators/Fix";
|
||||
modelName: "webhook_subscription",
|
||||
})
|
||||
@Fix
|
||||
class WebhookSubscription extends IdModel {
|
||||
class WebhookSubscription extends ParanoidModel {
|
||||
@NotEmpty
|
||||
@Column
|
||||
name: string;
|
||||
|
||||
Reference in New Issue
Block a user