fix: Missing SET NULL on shares relationship. closes #6609

This commit is contained in:
Tom Moor
2024-02-28 22:49:34 -05:00
parent 838b5d551e
commit 021cd253af

View File

@@ -0,0 +1,26 @@
'use strict';
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.removeConstraint("search_queries", "search_queries_shareId_fkey")
await queryInterface.changeColumn("search_queries", "shareId", {
type: Sequelize.UUID,
allowNull: true,
onDelete: "SET NULL",
references: {
model: "shares",
},
});
},
down: async (queryInterface, Sequelize) => {
await queryInterface.removeConstraint("search_queries", "search_queries_shareId_fkey")
await queryInterface.changeColumn("search_queries", "shareId", {
type: Sequelize.UUID,
allowNull: true,
references: {
model: "shares",
},
});
}
};