2025-06-03 16:19:50 +08:00
|
|
|
import { AssetTable } from 'src/schema/tables/asset.table';
|
2025-06-09 13:31:31 -04:00
|
|
|
import { Column, ForeignKeyColumn, Index, Table } from 'src/sql-tools';
|
2025-06-03 16:19:50 +08:00
|
|
|
|
|
|
|
|
@Table('ocr_search')
|
2025-06-09 13:31:31 -04:00
|
|
|
@Index({
|
|
|
|
|
name: 'idx_ocr_search_text',
|
|
|
|
|
using: 'gin',
|
|
|
|
|
expression: 'f_unaccent("text") gin_trgm_ops',
|
|
|
|
|
})
|
2025-06-03 16:19:50 +08:00
|
|
|
export class OcrSearchTable {
|
|
|
|
|
@ForeignKeyColumn(() => AssetTable, {
|
|
|
|
|
onDelete: 'CASCADE',
|
|
|
|
|
onUpdate: 'CASCADE',
|
|
|
|
|
primary: true,
|
|
|
|
|
})
|
|
|
|
|
assetId!: string;
|
|
|
|
|
|
|
|
|
|
@Column({ type: 'text' })
|
|
|
|
|
text!: string;
|
2025-10-15 14:42:19 -04:00
|
|
|
}
|