reorganizing

This commit is contained in:
rubikscraft
2022-03-03 22:48:03 +01:00
parent 59c50d9236
commit 0ac46696c8
29 changed files with 42 additions and 32 deletions

View File

@@ -0,0 +1,23 @@
import {
SupportedMime,
SupportedMimes,
} from 'picsur-shared/dist/dto/mimes.dto';
import { EImage } from 'picsur-shared/dist/entities/image.entity';
import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
@Entity()
export class EImageBackend extends EImage {
@PrimaryGeneratedColumn()
override id?: number;
@Index()
@Column({ unique: true })
override hash: string;
// Binary data
@Column({ type: 'bytea', nullable: false, select: false })
override data?: Buffer;
@Column({ enum: SupportedMimes })
override mime: SupportedMime;
}