Skip to content

Commit

Permalink
chore: make membership keys non-nullable (#1239)
Browse files Browse the repository at this point in the history
  • Loading branch information
fontanierh authored Sep 5, 2023
1 parent 8885d9e commit 333df1b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions front/lib/models/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,14 @@ Membership.init(
indexes: [{ fields: ["userId", "role"] }],
}
);
User.hasMany(Membership);
Workspace.hasMany(Membership);
User.hasMany(Membership, {
foreignKey: { allowNull: false },
onDelete: "CASCADE",
});
Workspace.hasMany(Membership, {
foreignKey: { allowNull: false },
onDelete: "CASCADE",
});

export class MembershipInvitation extends Model<
InferAttributes<MembershipInvitation>,
Expand Down

0 comments on commit 333df1b

Please sign in to comment.