2024-01-29 13:59:36 +00:00
|
|
|
import defineRoleEmojiPair from './models/roleEmojiPairs.js';
|
|
|
|
import defineVoiceChannel from './models/voiceChannels.js';
|
|
|
|
import defineMessage from './models/messages.js';
|
2024-01-28 23:30:33 +00:00
|
|
|
import { Sequelize } from 'sequelize';
|
|
|
|
import { config } from 'dotenv';
|
|
|
|
config();
|
|
|
|
|
2024-01-29 13:59:52 +00:00
|
|
|
const { DB_NAME } = process.env;
|
|
|
|
const sequelize = new Sequelize({
|
2024-01-28 23:30:33 +00:00
|
|
|
storage: `${DB_NAME}.sqlite`,
|
|
|
|
dialect: 'sqlite',
|
|
|
|
logging: false,
|
|
|
|
});
|
2024-01-28 23:32:13 +00:00
|
|
|
const RoleEmojiPair = defineRoleEmojiPair(sequelize);
|
2024-01-28 23:32:32 +00:00
|
|
|
const VoiceChannel = defineVoiceChannel(sequelize);
|
2024-01-28 23:31:40 +00:00
|
|
|
const Message = defineMessage(sequelize);
|
2024-01-28 23:30:33 +00:00
|
|
|
|
|
|
|
sequelize.sync();
|
|
|
|
|
2024-01-28 23:32:32 +00:00
|
|
|
export { sequelize, RoleEmojiPair, VoiceChannel, Message };
|