Remove EventTable in database, redesign frontend URL paths

This commit is contained in:
2024-10-12 15:54:03 +02:00
parent 1d4daac9ae
commit 203f8428a7
40 changed files with 955 additions and 1203 deletions

View File

@@ -2,8 +2,8 @@ import { BelongsTo, BelongsToMany, Column, DataType, ForeignKey, HasMany, Model,
import { Member } from "./member.model";
import { Genre } from "./genre.model";
import { Rating } from "./rating.model";
import { Event } from "./event.model";
import { BandGenre } from "./bandGenre.model";
import { Concert } from "./concert.model";
@Table({ timestamps: false })
export class Band extends Model {
@@ -45,8 +45,8 @@ export class Band extends Model {
@HasMany(() => Rating)
ratings: Rating[]
@HasMany(() => Event)
events: Event[]
@HasMany(() => Concert)
concerts: Concert[]
@BelongsToMany(() => Genre, () => BandGenre)
genres: Genre[]

View File

@@ -1,33 +1,39 @@
import { BelongsTo, Column, ForeignKey, HasMany, Model, Table } from "sequelize-typescript";
import { Location } from "./../locations/location.model";
import { Event } from "./event.model";
import { Ticket } from "../ordering/ticket.model";
import { Band } from "./band.model";
@Table({ timestamps: false })
export class Concert extends Model {
@Column
date: String
@Column
name: String
@Column
price: Number
@Column
image: String
@Column
inStock: Number
@Column
offered: Boolean
@ForeignKey(() => Band)
@Column
bandId: Number
@ForeignKey(() => Location)
@Column
locationId: Number
@ForeignKey(() => Event)
@Column
eventId: Number
// Relations
@BelongsTo(() => Event)
event: Event
@BelongsTo(() => Location)
location: Location

View File

@@ -1,27 +0,0 @@
import { BelongsTo, Column, ForeignKey, HasMany, Model, Table } from "sequelize-typescript";
import { Band } from "./band.model";
import { Concert } from "./concert.model";
@Table({ timestamps: false })
export class Event extends Model {
@Column
name: String
@ForeignKey(() => Band)
bandId: Number
@Column
offered: Boolean
@Column
image: String
// Relations
@BelongsTo(() => Band)
band: Band
@HasMany(() => Concert)
concerts: Concert[]
}