hunk.code_window:     restart: always
     database:
       container_name: immich_postgres
       image: postgres:14
       env_file:
         - .env
       environment:
         POSTGRES_PASSWORD: ${DB_PASSWORD}
         POSTGRES_USER: ${DB_USERNAME}
  
hunk.labels: keep keep keep keep replace keep keep keep keep keep
hunk.after_edit:     image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441
  
hunk.file_path: docker/docker-compose.yml
hunk.type: replace
file: import { Index, JoinColumn, OneToOne, PrimaryColumn } from 'typeorm';
  import { Column } from 'typeorm/decorator/columns/Column';
  import { Entity } from 'typeorm/decorator/entity/Entity';
  import { AssetEntity } from './asset.entity';
  
  @Entity('exif')
  export class ExifEntity {
    @OneToOne(() => AssetEntity, { onDelete: 'CASCADE', nullable: true })
    @JoinColumn()
    asset?: AssetEntity;
  
    @PrimaryColumn()
    assetId!: string;
  
    /* General info */
    @Column({ type: 'text', default: '' })
    description!: string; // or caption
  
    @Column({ type: 'integer', nullable: true })
    exifImageWidth!: number | null;
  
    @Column({ type: 'integer', nullable: true })
    exifImageHeight!: number | null;
  
    @Column({ type: 'bigint', nullable: true })
    fileSizeInByte!: number | null;
  
    @Column({ type: 'varchar', nullable: true })
    orientation!: string | null;
  
    @Column({ type: 'timestamptz', nullable: true })
    dateTimeOriginal!: Date | null;
  
    @Column({ type: 'timestamptz', nullable: true })
    modifyDate!: Date | null;
  
    @Column({ type: 'varchar', nullable: true })
    timeZone!: string | null;
  
    @Column({ type: 'float', nullable: true })
    latitude!: number | null;
  
    @Column({ type: 'float', nullable: true })
    longitude!: number | null;
  
    @Column({ type: 'varchar', nullable: true })
    city!: string | null;
  
    @Index('IDX_live_photo_cid')
    @Column({ type: 'varchar', nullable: true })
    livePhotoCID!: string | null;
  
    @Column({ type: 'varchar', nullable: true })
    state!: string | null;
  
    @Column({ type: 'varchar', nullable: true })
    country!: string | null;
  
    /* Image info */
    @Column({ type: 'varchar', nullable: true })
    make!: string | null;
  
    @Column({ type: 'varchar', nullable: true })
    model!: string | null;
  
    @Column({ type: 'varchar', nullable: true })
    lensModel!: string | null;
  
    @Column({ type: 'float8', nullable: true })
    fNumber!: number | null;
  
    @Column({ type: 'float8', nullable: true })
    focalLength!: number | null;
  
    @Column({ type: 'integer', nullable: true })
    iso!: number | null;
  
    @Column({ type: 'varchar', nullable: true })
    exposureTime!: string | null;
  
    /* Video info */
    @Column({ type: 'float8', nullable: true })
    fps?: number | null;
  
    @Index('exif_text_searchable', { synchronize: false })
    @Column({
      type: 'tsvector',
      generatedType: 'STORED',
      asExpression: `TO_TSVECTOR('english',
                           COALESCE(make, '') || ' ' ||
                           COALESCE(model, '') || ' ' ||
                           COALESCE(orientation, '') || ' ' ||
                           COALESCE("lensModel", '') || ' ' ||
                           COALESCE("city", '') || ' ' ||
                           COALESCE("state", '') || ' ' ||
                           COALESCE("country", ''))`,
    })
    exifTextSearchableColumn!: string;
  }
  