generated from Baipyrus/DiscordJS-Template
added role-emoji-pair to database
This commit is contained in:
parent
c19ef05c82
commit
56a2c697dc
@ -1,3 +1,4 @@
|
|||||||
|
import defineRoleEmojiPair from './models/roleEmojiPair.js';
|
||||||
import defineMessage from './models/message.js';
|
import defineMessage from './models/message.js';
|
||||||
import { Sequelize } from 'sequelize';
|
import { Sequelize } from 'sequelize';
|
||||||
import { config } from 'dotenv';
|
import { config } from 'dotenv';
|
||||||
@ -10,8 +11,9 @@ const sequelize = new Sequelize(DB_NAME, DB_USER, DB_PWD, {
|
|||||||
logging: false,
|
logging: false,
|
||||||
host: DB_HOST,
|
host: DB_HOST,
|
||||||
});
|
});
|
||||||
|
const RoleEmojiPair = defineRoleEmojiPair(sequelize);
|
||||||
const Message = defineMessage(sequelize);
|
const Message = defineMessage(sequelize);
|
||||||
|
|
||||||
sequelize.sync();
|
sequelize.sync();
|
||||||
|
|
||||||
export { sequelize, Message };
|
export { sequelize, RoleEmojiPair, Message };
|
||||||
|
17
models/roleEmojiPair.js
Normal file
17
models/roleEmojiPair.js
Normal file
@ -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,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user