* adding typeorm to api * switching to sqlite * switching to sqlite * switching to sqlite * migrating to sqlite * updating terraform * updating infrastructure
18 lines
499 B
TypeScript
18 lines
499 B
TypeScript
import { PilotEntity } from 'src/pilot/pilot.entity';
|
|
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm';
|
|
|
|
@Entity({ name: 'endorsements' })
|
|
export class EndorsementEntity {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string
|
|
|
|
@Column()
|
|
type: string;
|
|
|
|
@Column()
|
|
issueDate: Date;
|
|
|
|
@ManyToOne(() => PilotEntity, (pilot: PilotEntity) => pilot.endorsements, { onDelete: 'CASCADE', onUpdate: 'CASCADE' })
|
|
@JoinColumn({ name: 'pilotId' })
|
|
pilot: PilotEntity
|
|
} |