Files
immich/server/src/schema/tables/asset-ocr.table.ts
T
Daniel Dietzler a07d7b0c82 chore: migrate to sql-tools library (#26400)
Co-authored-by: Jason Rasmussen <jason@rasm.me>
2026-02-23 09:50:16 -05:00

49 lines
1018 B
TypeScript

import { Column, ForeignKeyColumn, Generated, PrimaryGeneratedColumn, Table } from '@immich/sql-tools';
import { AssetTable } from 'src/schema/tables/asset.table';
@Table('asset_ocr')
export class AssetOcrTable {
@PrimaryGeneratedColumn()
id!: Generated<string>;
@ForeignKeyColumn(() => AssetTable, { onDelete: 'CASCADE', onUpdate: 'CASCADE' })
assetId!: string;
// box positions are normalized, with values between 0 and 1
@Column({ type: 'real' })
x1!: number;
@Column({ type: 'real' })
y1!: number;
@Column({ type: 'real' })
x2!: number;
@Column({ type: 'real' })
y2!: number;
@Column({ type: 'real' })
x3!: number;
@Column({ type: 'real' })
y3!: number;
@Column({ type: 'real' })
x4!: number;
@Column({ type: 'real' })
y4!: number;
@Column({ type: 'real' })
boxScore!: number;
@Column({ type: 'real' })
textScore!: number;
@Column({ type: 'text' })
text!: string;
@Column({ type: 'boolean', default: true })
isVisible!: Generated<boolean>;
}