36 lines
756 B
JavaScript
36 lines
756 B
JavaScript
import {} from 'dotenv/config';
|
|
import { Sequelize } from 'sequelize';
|
|
import User from './user.js';
|
|
import Team from './team.js';
|
|
import Case from './case.js';
|
|
import Mark from './mark.js';
|
|
import UserInCase from './userInCase.js';
|
|
import TeamInCase from './teamInCase.js';
|
|
|
|
const { DB_NAME, DB_USER, DB_PWD, DB_HOST } = process.env;
|
|
|
|
export const models = {
|
|
Case,
|
|
Team,
|
|
User,
|
|
Mark,
|
|
UserInCase,
|
|
TeamInCase,
|
|
};
|
|
|
|
export const sequelize = new Sequelize(DB_NAME, DB_USER, DB_PWD, {
|
|
host: DB_HOST,
|
|
dialect: 'mysql',
|
|
dialectOptions: { multipleStatements: true },
|
|
define: {
|
|
charset: 'utf8mb4',
|
|
collate: 'utf8mb4_unicode_ci',
|
|
timestamps: true,
|
|
underscored: true,
|
|
paranoid: true,
|
|
},
|
|
logging: false,
|
|
});
|
|
|
|
export default { sequelize, models };
|