icons module
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,18 @@
|
||||
import { Migration } from '@mikro-orm/migrations';
|
||||
|
||||
export class Migration20260521055029 extends Migration {
|
||||
|
||||
override async up(): Promise<void> {
|
||||
this.addSql(`create table "icon_groups" ("id" char(26) not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, "name" varchar(255) not null, constraint "icon_groups_pkey" primary key ("id"));`);
|
||||
this.addSql(`create index "icon_groups_created_at_index" on "icon_groups" ("created_at");`);
|
||||
this.addSql(`create index "icon_groups_deleted_at_index" on "icon_groups" ("deleted_at");`);
|
||||
|
||||
this.addSql(`create table "icons" ("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, "group_id" char(26) not null, constraint "icons_pkey" primary key ("id"));`);
|
||||
this.addSql(`create index "icons_created_at_index" on "icons" ("created_at");`);
|
||||
this.addSql(`create index "icons_deleted_at_index" on "icons" ("deleted_at");`);
|
||||
this.addSql(`create index "icons_group_id_index" on "icons" ("group_id");`);
|
||||
|
||||
this.addSql(`alter table "icons" add constraint "icons_group_id_foreign" foreign key ("group_id") references "icon_groups" ("id") on update cascade;`);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Migration } from '@mikro-orm/migrations';
|
||||
|
||||
export class Migration20260521055339 extends Migration {
|
||||
|
||||
override async up(): Promise<void> {
|
||||
this.addSql(`drop index "icons_group_id_index";`);
|
||||
|
||||
this.addSql(`create index "icons_url_index" on "icons" ("url");`);
|
||||
}
|
||||
|
||||
override async down(): Promise<void> {
|
||||
this.addSql(`drop index "icons_url_index";`);
|
||||
|
||||
this.addSql(`create index "icons_group_id_index" on "icons" ("group_id");`);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user