mirror of
https://github.com/danbulant/ssps-bot
synced 2026-06-19 06:11:31 +00:00
oprava propojení
This commit is contained in:
parent
37b320d53e
commit
9e693cebdd
2 changed files with 3 additions and 17 deletions
|
|
@ -6,26 +6,10 @@ const Student = require("./student");
|
|||
const GroupStudent = sequelize.define(
|
||||
"group_student",
|
||||
{
|
||||
group: {
|
||||
type: DataTypes.STRING(16),
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: Group,
|
||||
key: "id"
|
||||
}
|
||||
},
|
||||
student: {
|
||||
type: DataTypes.STRING(45),
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: Student,
|
||||
key: "id"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
indexes: [{
|
||||
fields: ["group", "student"],
|
||||
fields: ["groupId", "studentId"],
|
||||
type: "UNIQUE"
|
||||
}]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,9 @@ Timetable.belongsTo(Teacher);
|
|||
Timetable.belongsTo(Room);
|
||||
|
||||
Person.hasOne(Student);
|
||||
Student.belongsTo(Person);
|
||||
Person.hasOne(Teacher);
|
||||
Student.belongsTo(Person);
|
||||
|
||||
Teacher.belongsTo(Room);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue