Skip to content
Snippets Groups Projects
Commit 54ade5e7 authored by tpgus2603's avatar tpgus2603
Browse files

bufgix conflict 해결(#2)

parents acc5dcc8 ac9fe9cb
No related branches found
No related tags found
1 merge request!5[#1#2#3] DB모델 객체 및 로그인 ,회원가입 구현
sync.js 0 → 100644
// sync.js
require('dotenv').config(); // 환경 변수 로드
const sequelize = require('./config/sequelize');
const model=require('./models'); // 모델들을 가져옴 (사이드 이펙트로 모델들이 등록됨)
async function syncDatabase() {
try {
// 데이터베이스 연결 테스트
await sequelize.authenticate();
console.log('데이터베이스 연결 성공.');
// 모든 모델 동기화
await sequelize.sync({ force: true });
console.log('모든 모델이 성공적으로 동기화되었습니다.');
// 연결 종료
await sequelize.close();
console.log('데이터베이스 연결이 종료되었습니다.');
} catch (error) {
console.error('데이터베이스 연결 실패:', error);
}
}
syncDatabase();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment