Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WebBack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
websystem
WebBack
Commits
54ade5e7
Commit
54ade5e7
authored
6 months ago
by
tpgus2603
Browse files
Options
Downloads
Plain Diff
bufgix conflict 해결(
#2
)
parents
acc5dcc8
ac9fe9cb
No related branches found
No related tags found
1 merge request
!5
[#1#2#3] DB모델 객체 및 로그인 ,회원가입 구현
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sync.js
+26
-0
26 additions, 0 deletions
sync.js
with
26 additions
and
0 deletions
sync.js
0 → 100644
+
26
−
0
View file @
54ade5e7
// 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
();
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment