diff --git a/database.js b/database.js index eb1be67..607751b 100644 --- a/database.js +++ b/database.js @@ -1,3 +1,4 @@ +import defineRoleEmojiPair from './models/roleEmojiPair.js'; import defineMessage from './models/message.js'; import { Sequelize } from 'sequelize'; import { config } from 'dotenv'; @@ -10,8 +11,9 @@ const sequelize = new Sequelize(DB_NAME, DB_USER, DB_PWD, { logging: false, host: DB_HOST, }); +const RoleEmojiPair = defineRoleEmojiPair(sequelize); const Message = defineMessage(sequelize); sequelize.sync(); -export { sequelize, Message }; +export { sequelize, RoleEmojiPair, Message }; diff --git a/models/roleEmojiPair.js b/models/roleEmojiPair.js new file mode 100644 index 0000000..7bfe3f1 --- /dev/null +++ b/models/roleEmojiPair.js @@ -0,0 +1,17 @@ +import { DataTypes } from "sequelize"; + +export default function(sequelize) { + return sequelize.define('RoleEmojiPair', { + id: { + defaultValue: DataTypes.UUIDV4, + type: DataTypes.UUID, + primaryKey: true, + }, + role: { + type: DataTypes.STRING, + }, + emoji: { + type: DataTypes.STRING, + } + }); +}