27 lines
384 B
TypeScript
27 lines
384 B
TypeScript
import { Entity, PrimaryGeneratedColumn, Column } from "typeorm";
|
|
import {
|
|
IsInt,
|
|
IsNotEmpty,
|
|
IsOptional,
|
|
IsPositive,
|
|
IsString,
|
|
} from "class-validator";
|
|
|
|
@Entity()
|
|
export class Track {
|
|
@PrimaryGeneratedColumn()
|
|
@IsOptional()
|
|
@IsInt()
|
|
id: number;
|
|
|
|
@Column()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
name: string;
|
|
|
|
@Column()
|
|
@IsInt()
|
|
@IsPositive()
|
|
length: string;
|
|
}
|