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
54b0a783
Commit
54b0a783
authored
Jul 26, 2021
by
Kim, Subin
Browse files
TicketFee Model 추가
parent
fef70b2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
server/db/index.js
View file @
54b0a783
...
@@ -4,6 +4,7 @@ import RoleModel from "../models/role.model.js";
...
@@ -4,6 +4,7 @@ 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
TheaterModel
from
"
../models/theater.model.js
"
;
import
TicketFeeModel
from
"
../models/ticketfee.model.js
"
;
import
TimeTableModel
from
'
../models/role.model.js
'
;
import
TimeTableModel
from
'
../models/role.model.js
'
;
import
ReservationModel
from
'
../models/reservation.model.js
'
;
import
ReservationModel
from
'
../models/reservation.model.js
'
;
import
dbConfig
from
"
../config/db.config.js
"
;
import
dbConfig
from
"
../config/db.config.js
"
;
...
@@ -29,14 +30,14 @@ const Role = RoleModel(sequelize)
...
@@ -29,14 +30,14 @@ const Role = RoleModel(sequelize)
const
Movie
=
MovieModel
(
sequelize
)
const
Movie
=
MovieModel
(
sequelize
)
const
Cinema
=
CinemaModel
(
sequelize
)
const
Cinema
=
CinemaModel
(
sequelize
)
const
Theater
=
TheaterModel
(
sequelize
)
const
Theater
=
TheaterModel
(
sequelize
)
const
TicketFee
=
TicketFeeModel
(
sequelize
)
const
TimeTable
=
TimeTableModel
(
sequelize
)
const
TimeTable
=
TimeTableModel
(
sequelize
)
const
Reservation
=
ReservationModel
(
sequelize
)
const
Reservation
=
ReservationModel
(
sequelize
)
User
.
belongsTo
(
Role
);
User
.
belongsTo
(
Role
);
Role
.
hasOne
(
User
);
Role
.
hasOne
(
User
);
User
.
belongsTo
(
Role
);
TicketFee
.
hasOne
(
Theater
,
{
foreignKey
:
"
theaterType
"
,
targetKey
:
"
theaterType
"
,
onDelete
:
"
Cascade
"
});
Role
.
hasOne
(
User
);
export
{
export
{
sequelize
,
sequelize
,
...
@@ -45,6 +46,7 @@ export {
...
@@ -45,6 +46,7 @@ export {
Movie
,
Movie
,
Cinema
,
Cinema
,
Theater
,
Theater
,
TicketFee
,
TimeTable
,
TimeTable
,
Reservation
Reservation
}
}
\ No newline at end of file
server/models/cinema.model.js
View file @
54b0a783
...
@@ -22,6 +22,9 @@ const CinemaModel = (sequelize) => {
...
@@ -22,6 +22,9 @@ const CinemaModel = (sequelize) => {
},
},
address
:
{
address
:
{
type
:
DataTypes
.
STRING
type
:
DataTypes
.
STRING
},
moreFeeInfo
:
{
type
:
DataTypes
.
TEXT
}
}
},
},
{
{
...
...
server/models/ticketfee.model.js
0 → 100644
View file @
54b0a783
import
Sequelize
from
"
sequelize
"
;
const
{
DataTypes
}
=
Sequelize
;
const
TicketFeeModel
=
(
sequelize
)
=>
{
const
TicketFee
=
sequelize
.
define
(
"
ticketfee
"
,
{
id
:
{
type
:
DataTypes
.
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
,
},
theaterType
:
{
type
:
DataTypes
.
STRING
},
weekdays
:
{
type
:
DataTypes
.
INTEGER
},
weekend
:
{
type
:
DataTypes
.
INTEGER
},
morning
:
{
type
:
DataTypes
.
INTEGER
},
day
:
{
type
:
DataTypes
.
INTEGER
},
night
:
{
type
:
DataTypes
.
INTEGER
},
youth
:
{
type
:
DataTypes
.
INTEGER
},
adult
:
{
type
:
DataTypes
.
INTEGER
},
senior
:
{
type
:
DataTypes
.
INTEGER
},
defaultPrice
:
{
type
:
DataTypes
.
INTEGER
,
}
},
{
timestamps
:
true
,
freezeTableName
:
true
,
tableName
:
"
ticketfees
"
}
);
return
TicketFee
;
};
export
default
TicketFeeModel
;
\ 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