Display all bands grouped by genre, create m:n association between Band and Genre in database

This commit is contained in:
2024-09-27 23:25:24 +02:00
parent 848e7abf92
commit 9b325c849e
29 changed files with 275 additions and 165 deletions

View File

@@ -0,0 +1,16 @@
import { AutoIncrement, Column, ForeignKey, Model, PrimaryKey, Table, Unique } from "sequelize-typescript";
import { Genre } from "./genre.model";
import { Band } from "./band.model";
@Table({ timestamps: false })
export class BandGenre extends Model {
@PrimaryKey
@Column({autoIncrement: true})
declare id: number
@ForeignKey(() => Genre)
genreId: number
@ForeignKey(() => Band)
bandId: number
}