@@ -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;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user