You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

32 lines
722 B

import { Entity, PrimaryGeneratedColumn, Column, BaseEntity, OneToMany, OneToOne, JoinColumn, CreateDateColumn, MoreThanOrEqual } from "typeorm";
import { MovieTicket } from "./MovieTicket";
import { MovieQuota } from "./MovieQuota";
@Entity()
export class User extends BaseEntity
{
@PrimaryGeneratedColumn()
id!: number;
@Column()
isAdmin!: boolean;
@Column({ length: 50 })
name!: string;
@Column({ length: 255 })
email!: string;
@Column({ type: "char", length: 60 })
password!: string;
@CreateDateColumn()
createdAt!: Date;
@OneToOne(() => MovieQuota, { nullable: true })
@JoinColumn()
quota!: MovieQuota | null;
@OneToMany(() => User, user => user.movieTickets)
movieTickets!: MovieTicket[];
}