mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-24 02:39:18 -05:00
This PR adds the missing migration for PostgreSQL and fix the migration for SQLite. re #1466
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class UpdateWebPush1743023615532 implements MigrationInterface {
|
|
name = 'UpdateWebPush1743023615532';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`ALTER TABLE "user_push_subscription" ADD "userAgent" character varying`
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE "user_push_subscription" ADD "createdAt" TIMESTAMP DEFAULT now()`
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE "user_push_subscription" DROP CONSTRAINT "UQ_f90ab5a4ed54905a4bb51a7148b"`
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`ALTER TABLE "user_push_subscription" ADD CONSTRAINT "UQ_f90ab5a4ed54905a4bb51a7148b" UNIQUE ("auth")`
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE "user_push_subscription" DROP COLUMN "createdAt"`
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE "user_push_subscription" DROP COLUMN "userAgent"`
|
|
);
|
|
}
|
|
}
|