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
3d810a85
Commit
3d810a85
authored
Jul 24, 2021
by
Kim, Subin
Browse files
TheaterModel 생성
parent
60d4bbf9
Changes
2
Hide whitespace changes
Inline
Side-by-side
server/db/index.js
View file @
3d810a85
...
@@ -3,6 +3,7 @@ import UserModel from "../models/user.model.js";
...
@@ -3,6 +3,7 @@ import UserModel from "../models/user.model.js";
import
RoleModel
from
"
../models/role.model.js
"
;
import
RoleModel
from
"
../models/role.model.js
"
;
import
MovieModel
from
"
../models/movie.model.js
"
;
import
MovieModel
from
"
../models/movie.model.js
"
;
import
CinemaModel
from
"
../models/cinema.model.js
"
;
import
CinemaModel
from
"
../models/cinema.model.js
"
;
import
TheaterModel
from
"
../models/theater.model.js
"
;
import
dbConfig
from
"
../config/db.config.js
"
;
import
dbConfig
from
"
../config/db.config.js
"
;
const
sequelize
=
new
Sequelize
(
const
sequelize
=
new
Sequelize
(
...
@@ -25,6 +26,7 @@ const User = UserModel(sequelize)
...
@@ -25,6 +26,7 @@ const User = UserModel(sequelize)
const
Role
=
RoleModel
(
sequelize
)
const
Role
=
RoleModel
(
sequelize
)
const
Movie
=
MovieModel
(
sequelize
)
const
Movie
=
MovieModel
(
sequelize
)
const
Cinema
=
CinemaModel
(
sequelize
)
const
Cinema
=
CinemaModel
(
sequelize
)
const
Theater
=
TheaterModel
(
sequelize
)
User
.
belongsTo
(
Role
);
User
.
belongsTo
(
Role
);
Role
.
hasOne
(
User
);
Role
.
hasOne
(
User
);
...
@@ -37,5 +39,6 @@ export {
...
@@ -37,5 +39,6 @@ export {
User
,
User
,
Role
,
Role
,
Movie
,
Movie
,
Cinema
Cinema
,
Theater
}
}
\ No newline at end of file
server/models/theater.model.js
0 → 100644
View file @
3d810a85
import
Sequelize
from
"
sequelize
"
;
const
{
DataTypes
}
=
Sequelize
;
const
TheaterModel
=
(
sequelize
)
=>
{
const
Theater
=
sequelize
.
define
(
"
theater
"
,
{
theaterNum
:
{
type
:
DataTypes
.
INTEGER
,
primaryKey
:
true
,
},
rows
:
{
type
:
DataTypes
.
STRING
,
},
columns
:
{
type
:
DataTypes
.
INTEGER
,
}
},
{
timestamps
:
true
,
freezeTableName
:
true
,
tableName
:
"
theaters
"
}
);
return
Theater
;
};
export
default
TheaterModel
;
\ 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