mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
* refactor: flatten infra folders * fix: database migrations * fix: test related import * fix: github actions workflow * chore: rename schemas to typesense-schemas
31 lines
976 B
TypeScript
31 lines
976 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class CreateSmartInfoTable1645130870184 implements MigrationInterface {
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
create table if not exists smart_info
|
|
(
|
|
id serial
|
|
constraint "PK_0beace66440e9713f5c40470e46"
|
|
primary key,
|
|
"assetId" uuid not null
|
|
constraint "UQ_5e3753aadd956110bf3ec0244ac"
|
|
unique
|
|
constraint "FK_5e3753aadd956110bf3ec0244ac"
|
|
references assets
|
|
on delete cascade,
|
|
tags text[]
|
|
);
|
|
|
|
create unique index if not exists "IDX_5e3753aadd956110bf3ec0244a"
|
|
on smart_info ("assetId");
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
drop table smart_info;
|
|
`);
|
|
}
|
|
}
|