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