mirror of
https://github.com/danbulant/ssps-bot
synced 2026-06-14 11:51:17 +00:00
42 lines
No EOL
1.1 KiB
JavaScript
42 lines
No EOL
1.1 KiB
JavaScript
const { Sequelize, Op, Model, DataTypes } = require("sequelize");
|
|
const sequelize = require("../sequelize");
|
|
const Student = require("./student");
|
|
|
|
const Rickroll = sequelize.define(
|
|
"rickrolls",
|
|
{
|
|
id: {
|
|
type: DataTypes.INTEGER,
|
|
autoIncrement: true,
|
|
primaryKey: true
|
|
},
|
|
source: {
|
|
type: DataTypes.STRING(45),
|
|
allowNull: false,
|
|
references: {
|
|
key: "id",
|
|
model: Student
|
|
}
|
|
},
|
|
target: {
|
|
type: DataTypes.STRING(45),
|
|
allowNull: false,
|
|
references: {
|
|
key: "id",
|
|
model: Student
|
|
}
|
|
},
|
|
date: {
|
|
type: DataTypes.DATE,
|
|
defaultValue: "CURRENT_TIMESTAMP()"
|
|
},
|
|
link: {
|
|
type: DataTypes.STRING(255),
|
|
defaultValue: "'https://www.youtube.com/watch?v=dQw4w9WgXcQ'"
|
|
}
|
|
}
|
|
);
|
|
EventGroup.belongsTo(Student, { as: "source" });
|
|
EventGroup.belongsTo(Student, { as: "target" });
|
|
|
|
module.exports = Rickroll; |