parent
c85fddaa8e
commit
a6bd723511
|
@ -1,14 +1,26 @@
|
|||
import { Entity, PrimaryGeneratedColumn, Column } from "typeorm";
|
||||
import {
|
||||
IsInt,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsPositive,
|
||||
IsString,
|
||||
} from "class-validator";
|
||||
|
||||
@Entity()
|
||||
export class Track {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
@PrimaryGeneratedColumn()
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
@Column()
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
name: string;
|
||||
|
||||
//Length in meters
|
||||
@Column()
|
||||
length: string;
|
||||
@Column()
|
||||
@IsInt()
|
||||
@IsPositive()
|
||||
length: string;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue