22 lines
430 B
JavaScript
22 lines
430 B
JavaScript
"use strict";
|
|
const {
|
|
Model
|
|
} = require("sequelize");
|
|
module.exports = (sequelize, DataTypes) => {
|
|
class Department extends Model {
|
|
static associate(models) {
|
|
Department.hasMany(models.Command);
|
|
Department.hasMany(models.User);
|
|
}
|
|
}
|
|
Department.init({
|
|
name: {
|
|
type: DataTypes.STRING,
|
|
primaryKey: true
|
|
}
|
|
}, {
|
|
sequelize,
|
|
modelName: "Department",
|
|
});
|
|
return Department;
|
|
};
|