fix: Missing onDelete constraint

This commit is contained in:
Tom Moor
2022-12-17 21:19:55 -05:00
parent bf21863dbf
commit 4b66a52a52

View File

@@ -0,0 +1,26 @@
'use strict';
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.removeConstraint("webhook_subscriptions", "webhook_subscriptions_teamId_fkey")
await queryInterface.changeColumn("webhook_subscriptions", "teamId", {
type: Sequelize.UUID,
allowNull: false,
onDelete: "cascade",
references: {
model: "teams",
},
});
},
down: async (queryInterface, Sequelize) => {
await queryInterface.removeConstraint("webhook_subscriptions", "webhook_subscriptions_teamId_fkey")
await queryInterface.changeColumn("webhook_subscriptions", "teamId", {
type: Sequelize.UUID,
allowNull: false,
references: {
model: "teams",
},
});
}
};