Partypack/Server/Source/Schemas/Rating.ts

18 lines
430 B
TypeScript
Raw Permalink Normal View History

2024-01-28 11:07:10 +01:00
import { BaseEntity, Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { User } from "./User";
import { Song } from "./Song";
@Entity()
export class Rating extends BaseEntity {
@PrimaryGeneratedColumn("uuid")
ID: string;
@ManyToOne(() => User, U => U.Ratings)
Author: User;
@ManyToOne(() => Song, S => S.Ratings)
Rated: Song;
@Column()
Stars: number;
2024-01-24 01:35:47 +01:00
}