Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
butter-studio
Commits
4a618c01
Commit
4a618c01
authored
Jul 14, 2021
by
Kim, Subin
Browse files
Model
parent
d55253a5
Changes
2
Show whitespace changes
Inline
Side-by-side
server/db/index.js
View file @
4a618c01
import
{
Sequelize
}
from
"
sequelize
"
;
// import UserModel from "../models/user.model.js";
import
MovieModel
from
"
../models/movie.model.js
"
;
import
dbConfig
from
"
../config/db.config.js
"
;
const
sequelize
=
new
Sequelize
(
...
...
@@ -17,6 +19,11 @@ const sequelize = new Sequelize(
}
);
// const User = UserModel(sequelize)
const
Movie
=
MovieModel
(
sequelize
)
export
{
sequelize
,
// User,
Movie
}
\ No newline at end of file
server/models/movie.model.js
0 → 100644
View file @
4a618c01
import
Sequelize
from
"
sequelize
"
;
const
{
DataTypes
}
=
Sequelize
;
const
MovieModel
=
(
sequelize
)
=>
{
const
Movie
=
sequelize
.
define
(
"
movie
"
,
{
id
:
{
type
:
DataTypes
.
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
,
},
movieId
:
{
type
:
DataTypes
.
INTEGER
}
},
{
timestamps
:
true
,
freezeTableName
:
true
,
tableName
:
"
movies
"
}
);
return
Movie
;
};
export
default
MovieModel
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment