index.js 695 Bytes
Newer Older
Kim, Subin's avatar
Kim, Subin committed
1
import { Sequelize } from "sequelize";
Kim, Subin's avatar
Model    
Kim, Subin committed
2
3
// import UserModel from "../models/user.model.js";
import MovieModel from "../models/movie.model.js";
Kim, Subin's avatar
Kim, Subin committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import dbConfig from "../config/db.config.js";

const sequelize = new Sequelize(
    String(dbConfig.database),
    String(dbConfig.username),
    dbConfig.password,
    {
        host: dbConfig.host,
        dialect: dbConfig.dialect,
        pool: {
            max: dbConfig.pool?.max,
            min: dbConfig.pool?.min,
            acquire: dbConfig.pool?.acquire,
            idle: dbConfig.pool?.idle,
        },
    }
);

Kim, Subin's avatar
Model    
Kim, Subin committed
22
23
24
// const User = UserModel(sequelize)
const Movie = MovieModel(sequelize)

Kim, Subin's avatar
Kim, Subin committed
25
26
export {
    sequelize,
Kim, Subin's avatar
Model    
Kim, Subin committed
27
28
    // User,
    Movie
Kim, Subin's avatar
Kim, Subin committed
29
}