Partypack/Server/Source/Schemas/User.ts
McMistrzYT 62407f3d3d shtuff
2024-01-24 01:35:47 +01:00

19 lines
510 B
TypeScript

import { BaseEntity, Column, Entity, JoinTable, ManyToMany, OneToMany, PrimaryColumn } from "typeorm";
import { Song } from "./Song";
import { Rating } from "./Rating";
@Entity()
export class User extends BaseEntity {
@PrimaryColumn()
ID: string;
@Column({ type: "simple-json" })
Library: { SongID: string, Overriding: string }[];
@OneToMany(() => Rating, R => R.Author)
Ratings: Rating[];
@ManyToMany(() => Song, { eager: true })
@JoinTable()
BookmarkedSongs: Song[];
}