1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/backend/model/sql/enitites/FileEntity.ts
2018-11-26 00:26:29 +01:00

18 lines
449 B
TypeScript

import {Column, Entity, ManyToOne, PrimaryGeneratedColumn} from 'typeorm';
import {DirectoryEntity} from './DirectoryEntity';
import {FileDTO} from '../../../../common/entities/FileDTO';
@Entity()
export class FileEntity implements FileDTO {
@PrimaryGeneratedColumn()
id: number;
@Column('text')
name: string;
@ManyToOne(type => DirectoryEntity, directory => directory.metaFile, {onDelete: 'CASCADE'})
directory: DirectoryEntity;
}