Add ToursTable, update API documentation
This commit is contained in:
24
software/backend/models/acts/tour.model.ts
Normal file
24
software/backend/models/acts/tour.model.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { BelongsTo, Column, ForeignKey, HasMany, Model, Table } from "sequelize-typescript";
|
||||
import { Band } from "./band.model";
|
||||
import { Show } from "./show.model";
|
||||
|
||||
@Table({ timestamps: false })
|
||||
export class Tour extends Model {
|
||||
@Column
|
||||
name: String
|
||||
|
||||
@ForeignKey(() => Band)
|
||||
bandId: Number
|
||||
|
||||
@Column
|
||||
offered: Boolean
|
||||
|
||||
|
||||
// Relations
|
||||
|
||||
@BelongsTo(() => Band)
|
||||
band: Band
|
||||
|
||||
@HasMany(() => Show)
|
||||
shows: Show[]
|
||||
}
|
||||
Reference in New Issue
Block a user