mirror of
https://github.com/danbulant/ssps-bot
synced 2026-07-05 19:10:45 +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(
|
const GroupStudent = sequelize.define(
|
||||||
"group_student",
|
"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: [{
|
indexes: [{
|
||||||
fields: ["group", "student"],
|
fields: ["groupId", "studentId"],
|
||||||
type: "UNIQUE"
|
type: "UNIQUE"
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,9 @@ Timetable.belongsTo(Teacher);
|
||||||
Timetable.belongsTo(Room);
|
Timetable.belongsTo(Room);
|
||||||
|
|
||||||
Person.hasOne(Student);
|
Person.hasOne(Student);
|
||||||
|
Student.belongsTo(Person);
|
||||||
Person.hasOne(Teacher);
|
Person.hasOne(Teacher);
|
||||||
|
Student.belongsTo(Person);
|
||||||
|
|
||||||
Teacher.belongsTo(Room);
|
Teacher.belongsTo(Room);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue