mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 09:15:44 +03:00
chore: migrate database files (#8126)
This commit is contained in:
16
server/src/migrations/1684410565398-AddStorageLabel.ts
Normal file
16
server/src/migrations/1684410565398-AddStorageLabel.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class AddStorageLabel1684410565398 implements MigrationInterface {
|
||||
name = 'AddStorageLabel1684410565398'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "users" ADD "storageLabel" character varying`);
|
||||
await queryRunner.query(`ALTER TABLE "users" ADD CONSTRAINT "UQ_b309cf34fa58137c416b32cea3a" UNIQUE ("storageLabel")`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "users" DROP CONSTRAINT "UQ_b309cf34fa58137c416b32cea3a"`);
|
||||
await queryRunner.query(`ALTER TABLE "users" DROP COLUMN "storageLabel"`);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user