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