diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2024-03-15 20:23:41 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2024-03-15 20:23:41 +0000 |
| commit | aeb8b66375335e8c9d6cb9cb0d8d7da3d8b79628 (patch) | |
| tree | 0ddaa24fc536ac03493d6357e481df31dad77b16 /src/storage/entity | |
Initial commit
Diffstat (limited to 'src/storage/entity')
| -rw-r--r-- | src/storage/entity/stored-file.entity.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/storage/entity/stored-file.entity.ts b/src/storage/entity/stored-file.entity.ts new file mode 100644 index 0000000..e4b4931 --- /dev/null +++ b/src/storage/entity/stored-file.entity.ts @@ -0,0 +1,18 @@ +import { FileMetadata } from 'src/file/entity/file.entity'; +import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, OneToOne, JoinColumn } from 'typeorm'; + +@Entity() +export class StoredFile { + @PrimaryGeneratedColumn() + id: number; + + @CreateDateColumn() + creationDate: Date; + + @Column({ nullable: false }) + b64Contents: string; + + @OneToOne(() => FileMetadata, (metadata) => metadata.id, { nullable: false }) + @JoinColumn() + fileMetadata: FileMetadata; +} |
