2019-01-07 06:15:52 +08:00
|
|
|
import {Column, Entity, ManyToOne, PrimaryGeneratedColumn, Index} from 'typeorm';
|
2018-11-26 07:26:29 +08:00
|
|
|
import {DirectoryEntity} from './DirectoryEntity';
|
|
|
|
import {FileDTO} from '../../../../common/entities/FileDTO';
|
|
|
|
|
|
|
|
|
|
|
|
@Entity()
|
|
|
|
export class FileEntity implements FileDTO {
|
|
|
|
|
2019-01-07 06:15:52 +08:00
|
|
|
@Index()
|
2019-01-28 03:36:42 +08:00
|
|
|
@PrimaryGeneratedColumn({unsigned: true})
|
2018-11-26 07:26:29 +08:00
|
|
|
id: number;
|
|
|
|
|
|
|
|
@Column('text')
|
|
|
|
name: string;
|
|
|
|
|
2019-01-07 06:15:52 +08:00
|
|
|
@Index()
|
2018-11-26 07:26:29 +08:00
|
|
|
@ManyToOne(type => DirectoryEntity, directory => directory.metaFile, {onDelete: 'CASCADE'})
|
|
|
|
directory: DirectoryEntity;
|
|
|
|
}
|