background pattern
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-07-04 15:43:13 +03:30
parent fc4740f1c1
commit f8f3fa528e
8 changed files with 130 additions and 1 deletions
@@ -0,0 +1,21 @@
import { Migration } from '@mikro-orm/migrations';
export class Migration20260704120000_AddShopBackgroundFields extends Migration {
override async up(): Promise<void> {
this.addSql(`alter table "shops" add column "bg_type" varchar(255) null;`);
this.addSql(`alter table "shops" add column "bg_url" varchar(255) null;`);
this.addSql(`alter table "shops" add column "bg_opacity" varchar(255) null;`);
this.addSql(`alter table "shops" add column "bg_blur" varchar(255) null;`);
this.addSql(`alter table "shops" add column "bg_overlay" varchar(255) null;`);
}
override async down(): Promise<void> {
this.addSql(`alter table "shops" drop column "bg_overlay";`);
this.addSql(`alter table "shops" drop column "bg_blur";`);
this.addSql(`alter table "shops" drop column "bg_opacity";`);
this.addSql(`alter table "shops" drop column "bg_url";`);
this.addSql(`alter table "shops" drop column "bg_type";`);
}
}
@@ -0,0 +1,15 @@
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;`);
}
}