mirror of
https://github.com/outline/outline.git
synced 2026-11-26 23:50:14 +03:00
Add missing team->user constraint (#4411)
* Add missing team->user constraint * fix: teamPermanentDeleter cannot complete when team has domains
This commit is contained in:
1 parent
26946853da
commit
6788005115
2 files changed
+19
-7
No files matched your search
@@ -175,13 +175,6 @@ async function teamPermanentDeleter(team: Team) {
|
||||
force: true,
|
||||
transaction,
|
||||
});
|
||||
await User.destroy({
|
||||
where: {
|
||||
teamId,
|
||||
},
|
||||
force: true,
|
||||
transaction,
|
||||
});
|
||||
await team.destroy({
|
||||
force: true,
|
||||
transaction,
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.changeColumn("users", "teamId", {
|
||||
type: Sequelize.UUID,
|
||||
onDelete: "cascade",
|
||||
references: {
|
||||
model: "teams",
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.changeColumn("users", "teamId", {
|
||||
type: Sequelize.UUID,
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user