16 lines
761 B
TypeScript
16 lines
761 B
TypeScript
import { Migration } from '@mikro-orm/migrations';
|
|
|
|
export class Migration20260704130000_AddBackgroundsTable extends Migration {
|
|
|
|
override async up(): Promise<void> {
|
|
this.addSql(`create table "backgrounds" ("id" char(26) not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, "url" varchar(255) not null, constraint "backgrounds_pkey" primary key ("id"));`);
|
|
this.addSql(`create index "backgrounds_created_at_index" on "backgrounds" ("created_at");`);
|
|
this.addSql(`create index "backgrounds_deleted_at_index" on "backgrounds" ("deleted_at");`);
|
|
}
|
|
|
|
override async down(): Promise<void> {
|
|
this.addSql(`drop table if exists "backgrounds" cascade;`);
|
|
}
|
|
|
|
}
|