chore: Webhook subscription creator delete cascade
This commit is contained in:
24
server/migrations/20231129011114-cascade-delete.js
Normal file
24
server/migrations/20231129011114-cascade-delete.js
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
up: async (queryInterface, Sequelize) => {
|
||||||
|
await queryInterface.removeConstraint("webhook_subscriptions", "webhook_subscriptions_createdById_fkey")
|
||||||
|
await queryInterface.changeColumn("webhook_subscriptions", "createdById", {
|
||||||
|
type: Sequelize.UUID,
|
||||||
|
onDelete: "cascade",
|
||||||
|
references: {
|
||||||
|
model: "users",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
down: async (queryInterface, Sequelize) => {
|
||||||
|
await queryInterface.removeConstraint("webhook_subscriptions", "webhook_subscriptions_createdById_fkey")
|
||||||
|
await queryInterface.changeColumn("webhook_subscriptions", "createdById", {
|
||||||
|
type: Sequelize.UUID,
|
||||||
|
references: {
|
||||||
|
model: "users",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user