Make project table associated with the user
This commit is contained in:
@@ -8,6 +8,19 @@ function defineProject(sequelize, DataTypes) {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
},
|
||||
isPublic: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
},
|
||||
userId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: 'user',
|
||||
key: 'id',
|
||||
},
|
||||
onDelete: 'CASCADE',
|
||||
},
|
||||
});
|
||||
|
||||
Project.associate = (models) => {
|
||||
|
||||
Reference in New Issue
Block a user