* adding typeorm to api * switching to sqlite * switching to sqlite * switching to sqlite * migrating to sqlite * updating terraform * updating infrastructure
18 lines
460 B
TypeScript
18 lines
460 B
TypeScript
import { LogEntity } from 'src/log/log.entity';
|
|
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm';
|
|
|
|
@Entity({ name: 'tracks' })
|
|
export class TrackEntity {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column()
|
|
url: string;
|
|
|
|
@Column()
|
|
order: number;
|
|
|
|
@ManyToOne(() => LogEntity, (log: LogEntity) => log.tracks, { onDelete: 'CASCADE', onUpdate: 'CASCADE' })
|
|
@JoinColumn({ name: 'logId' })
|
|
log: LogEntity;
|
|
} |