mirror of
https://github.com/outline/outline.git
synced 2026-11-28 00:09:58 +03:00
fix: Missing cascade constraints on stars table
This commit is contained in:
1 parent
2e36ad9d1f
commit
1328162921
1 file changed
+26
@@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.removeConstraint("stars", "stars_collectionId_fkey")
|
||||
await queryInterface.changeColumn("stars", "collectionId", {
|
||||
type: Sequelize.UUID,
|
||||
allowNull: true,
|
||||
onDelete: "cascade",
|
||||
references: {
|
||||
model: "collections",
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.removeConstraint("stars", "stars_collectionId_fkey")
|
||||
await queryInterface.changeColumn("stars", "collectionId", {
|
||||
type: Sequelize.UUID,
|
||||
allowNull: true,
|
||||
references: {
|
||||
model: "collections",
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user