mirror of
https://github.com/CaramelFur/Picsur.git
synced 2025-11-14 07:45:39 +01:00
reorganizing
This commit is contained in:
23
backend/src/models/entities/image.entity.ts
Normal file
23
backend/src/models/entities/image.entity.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user