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
a276f40f
Commit
a276f40f
authored
Jul 23, 2021
by
Kim, Subin
Browse files
cinema Model
parent
ef0b5a8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
server/db/index.js
View file @
a276f40f
...
...
@@ -2,6 +2,7 @@ import { Sequelize } from "sequelize";
import
UserModel
from
"
../models/user.model.js
"
;
import
RoleModel
from
"
../models/role.model.js
"
;
import
MovieModel
from
"
../models/movie.model.js
"
;
import
CinemaModel
from
"
../models/cinema.model.js
"
;
import
dbConfig
from
"
../config/db.config.js
"
;
const
sequelize
=
new
Sequelize
(
...
...
@@ -23,6 +24,7 @@ const sequelize = new Sequelize(
const
User
=
UserModel
(
sequelize
)
const
Role
=
RoleModel
(
sequelize
)
const
Movie
=
MovieModel
(
sequelize
)
const
Cinema
=
CinemaModel
(
sequelize
)
User
.
belongsTo
(
Role
);
Role
.
hasOne
(
User
);
...
...
@@ -31,5 +33,6 @@ export {
sequelize
,
User
,
Role
,
Movie
Movie
,
Cinema
}
\ No newline at end of file
server/models/cinema.model.js
0 → 100644
View file @
a276f40f
import
Sequelize
from
"
sequelize
"
;
const
{
DataTypes
}
=
Sequelize
;
const
CinemaModel
=
(
sequelize
)
=>
{
const
Cinema
=
sequelize
.
define
(
"
cinema
"
,
{
id
:
{
type
:
DataTypes
.
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
,
},
cinemaName
:
{
type
:
DataTypes
.
STRING
,
},
transportation
:
{
type
:
DataTypes
.
TEXT
},
parking
:
{
type
:
DataTypes
.
TEXT
},
address
:
{
type
:
DataTypes
.
STRING
}
},
{
timestamps
:
true
,
freezeTableName
:
true
,
tableName
:
"
cinemas
"
}
);
return
Cinema
;
};
export
default
CinemaModel
;
\ 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