2025-04-07 15:12:12 -04:00
|
|
|
import { UpdatedAtTrigger, UpdateIdColumn } from 'src/decorators';
|
2025-03-29 09:26:24 -04:00
|
|
|
import { AssetTable } from 'src/schema/tables/asset.table';
|
2025-06-30 13:19:16 -04:00
|
|
|
import { Column, ForeignKeyColumn, Generated, Int8, Table, Timestamp, UpdateDateColumn } from 'src/sql-tools';
|
2025-03-28 10:40:09 -04:00
|
|
|
|
2025-12-04 15:33:44 +01:00
|
|
|
export type LockableProperty = (typeof lockableProperties)[number];
|
2025-12-05 12:56:30 -05:00
|
|
|
export const lockableProperties = [
|
|
|
|
|
'description',
|
|
|
|
|
'dateTimeOriginal',
|
|
|
|
|
'latitude',
|
|
|
|
|
'longitude',
|
|
|
|
|
'rating',
|
|
|
|
|
'timeZone',
|
|
|
|
|
] as const;
|
2025-12-04 15:33:44 +01:00
|
|
|
|
2025-07-14 10:13:06 -04:00
|
|
|
@Table('asset_exif')
|
|
|
|
|
@UpdatedAtTrigger('asset_exif_updatedAt')
|
|
|
|
|
export class AssetExifTable {
|
2025-03-28 10:40:09 -04:00
|
|
|
@ForeignKeyColumn(() => AssetTable, { onDelete: 'CASCADE', primary: true })
|
|
|
|
|
assetId!: string;
|
|
|
|
|
|
2025-04-07 15:12:12 -04:00
|
|
|
@Column({ type: 'character varying', nullable: true })
|
|
|
|
|
make!: string | null;
|
2025-03-28 10:40:09 -04:00
|
|
|
|
2025-04-07 15:12:12 -04:00
|
|
|
@Column({ type: 'character varying', nullable: true })
|
|
|
|
|
model!: string | null;
|
2025-03-28 10:40:09 -04:00
|
|
|
|
|
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
|
|
|
exifImageWidth!: number | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
|
|
|
exifImageHeight!: number | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'bigint', nullable: true })
|
2025-06-30 13:19:16 -04:00
|
|
|
fileSizeInByte!: Int8 | null;
|
2025-03-28 10:40:09 -04:00
|
|
|
|
|
|
|
|
@Column({ type: 'character varying', nullable: true })
|
|
|
|
|
orientation!: string | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'timestamp with time zone', nullable: true })
|
2025-06-30 13:19:16 -04:00
|
|
|
dateTimeOriginal!: Timestamp | null;
|
2025-03-28 10:40:09 -04:00
|
|
|
|
|
|
|
|
@Column({ type: 'timestamp with time zone', nullable: true })
|
2025-06-30 13:19:16 -04:00
|
|
|
modifyDate!: Timestamp | null;
|
2025-03-28 10:40:09 -04:00
|
|
|
|
|
|
|
|
@Column({ type: 'character varying', nullable: true })
|
2025-04-07 15:12:12 -04:00
|
|
|
lensModel!: string | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'double precision', nullable: true })
|
|
|
|
|
fNumber!: number | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'double precision', nullable: true })
|
|
|
|
|
focalLength!: number | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
|
|
|
iso!: number | null;
|
2025-03-28 10:40:09 -04:00
|
|
|
|
|
|
|
|
@Column({ type: 'double precision', nullable: true })
|
|
|
|
|
latitude!: number | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'double precision', nullable: true })
|
|
|
|
|
longitude!: number | null;
|
|
|
|
|
|
2025-07-14 10:13:06 -04:00
|
|
|
@Column({ type: 'character varying', nullable: true, index: true })
|
2025-03-28 10:40:09 -04:00
|
|
|
city!: string | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'character varying', nullable: true })
|
|
|
|
|
state!: string | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'character varying', nullable: true })
|
|
|
|
|
country!: string | null;
|
|
|
|
|
|
2025-04-07 15:12:12 -04:00
|
|
|
@Column({ type: 'text', default: '' })
|
2025-06-30 13:19:16 -04:00
|
|
|
description!: Generated<string>; // or caption
|
2025-03-28 10:40:09 -04:00
|
|
|
|
2025-04-07 15:12:12 -04:00
|
|
|
@Column({ type: 'double precision', nullable: true })
|
2025-06-30 13:19:16 -04:00
|
|
|
fps!: number | null;
|
2025-03-28 10:40:09 -04:00
|
|
|
|
|
|
|
|
@Column({ type: 'character varying', nullable: true })
|
2025-04-07 15:12:12 -04:00
|
|
|
exposureTime!: string | null;
|
2025-03-28 10:40:09 -04:00
|
|
|
|
2025-07-14 10:13:06 -04:00
|
|
|
@Column({ type: 'character varying', nullable: true, index: true })
|
2025-04-07 15:12:12 -04:00
|
|
|
livePhotoCID!: string | null;
|
2025-03-28 10:40:09 -04:00
|
|
|
|
2025-04-07 15:12:12 -04:00
|
|
|
@Column({ type: 'character varying', nullable: true })
|
|
|
|
|
timeZone!: string | null;
|
2025-03-28 10:40:09 -04:00
|
|
|
|
|
|
|
|
@Column({ type: 'character varying', nullable: true })
|
2025-04-07 15:12:12 -04:00
|
|
|
projectionType!: string | null;
|
2025-03-28 10:40:09 -04:00
|
|
|
|
|
|
|
|
@Column({ type: 'character varying', nullable: true })
|
|
|
|
|
profileDescription!: string | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'character varying', nullable: true })
|
|
|
|
|
colorspace!: string | null;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
|
|
|
bitsPerSample!: number | null;
|
|
|
|
|
|
2025-07-14 10:13:06 -04:00
|
|
|
@Column({ type: 'character varying', nullable: true, index: true })
|
2025-04-07 15:12:12 -04:00
|
|
|
autoStackId!: string | null;
|
|
|
|
|
|
2025-03-28 10:40:09 -04:00
|
|
|
@Column({ type: 'integer', nullable: true })
|
|
|
|
|
rating!: number | null;
|
|
|
|
|
|
2025-04-07 15:12:12 -04:00
|
|
|
@UpdateDateColumn({ default: () => 'clock_timestamp()' })
|
2025-06-30 13:19:16 -04:00
|
|
|
updatedAt!: Generated<Date>;
|
2025-04-07 15:12:12 -04:00
|
|
|
|
2025-07-14 10:13:06 -04:00
|
|
|
@UpdateIdColumn({ index: true })
|
2025-06-30 13:19:16 -04:00
|
|
|
updateId!: Generated<string>;
|
2025-12-04 15:33:44 +01:00
|
|
|
|
|
|
|
|
@Column({ type: 'character varying', array: true, nullable: true })
|
|
|
|
|
lockedProperties!: Array<LockableProperty> | null;
|
2025-03-28 10:40:09 -04:00
|
|
|
}
|