bg migrations

This commit is contained in:
2026-06-20 20:38:03 +03:30
parent ef598a4c28
commit 2786010f0d
2 changed files with 324 additions and 0 deletions
+310
View File
@@ -127,6 +127,99 @@
"foreignKeys": {},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"url": {
"name": "url",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
}
},
"name": "backgrounds",
"schema": "public",
"indexes": [
{
"keyName": "backgrounds_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "backgrounds_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "backgrounds_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {},
"nativeEnums": {}
},
{
"columns": {
"id": {
@@ -931,6 +1024,46 @@
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"bg_url": {
"name": "bg_url",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"bg_opacity": {
"name": "bg_opacity",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"bg_blur": {
"name": "bg_blur",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"bg_overlay": {
"name": "bg_overlay",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
}
},
"name": "restaurants",
@@ -1113,6 +1246,16 @@
"length": 255,
"mappedType": "string"
},
"card_owner": {
"name": "card_owner",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"enabled": {
"name": "enabled",
"type": "boolean",
@@ -5428,6 +5571,173 @@
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"user_id": {
"name": "user_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"restaurant_id": {
"name": "restaurant_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"order_count": {
"name": "order_count",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "integer"
},
"total_order_amount": {
"name": "total_order_amount",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "integer"
}
},
"name": "user_restuarant",
"schema": "public",
"indexes": [
{
"keyName": "user_restuarant_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "user_restuarant_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "user_restuarant_restaurant_id_index",
"columnNames": [
"restaurant_id"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "user_restuarant_user_id_restaurant_id_unique",
"columnNames": [
"user_id",
"restaurant_id"
],
"composite": true,
"constraint": true,
"primary": false,
"unique": true
},
{
"keyName": "user_restuarant_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"user_restuarant_user_id_foreign": {
"constraintName": "user_restuarant_user_id_foreign",
"columnNames": [
"user_id"
],
"localTableName": "public.user_restuarant",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.users",
"updateRule": "cascade"
},
"user_restuarant_restaurant_id_foreign": {
"constraintName": "user_restuarant_restaurant_id_foreign",
"columnNames": [
"restaurant_id"
],
"localTableName": "public.user_restuarant",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.restaurants",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
@@ -0,0 +1,14 @@
import { Migration } from '@mikro-orm/migrations';
export class Migration20260620170106 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");`);
this.addSql(`alter table "restaurants" add column "bg_url" varchar(255) null, add column "bg_opacity" varchar(255) null, add column "bg_blur" varchar(255) null, add column "bg_overlay" varchar(255) null;`);
}
}