diff --git a/database/migrations/.snapshot-dzone-db.json b/database/migrations/.snapshot-dzone-db.json index b9ef612..1f253af 100644 --- a/database/migrations/.snapshot-dzone-db.json +++ b/database/migrations/.snapshot-dzone-db.json @@ -169,7 +169,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -389,7 +390,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -648,7 +650,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -885,7 +888,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -1123,7 +1127,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -1359,7 +1364,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -1522,7 +1528,8 @@ "default": "'USER'", "enumItems": [ "ADMIN", - "USER" + "USER", + "WATCHER" ], "mappedType": "enum" } @@ -1549,7 +1556,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -1807,7 +1815,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -2044,7 +2053,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -2377,7 +2387,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -2595,7 +2606,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -2856,7 +2868,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -3124,7 +3137,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -3332,7 +3346,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -3775,7 +3790,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -4111,7 +4127,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -4362,7 +4379,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -4570,7 +4588,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -4943,7 +4962,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -5254,7 +5274,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -5504,7 +5525,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -5722,7 +5744,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -5986,7 +6009,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -6204,7 +6228,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -6456,13 +6481,23 @@ }, "exit_at": { "name": "exit_at", - "type": "timestamptz", + "type": "varchar(255)", "unsigned": false, "autoincrement": false, "primary": false, "nullable": true, - "length": 6, - "mappedType": "datetime" + "length": 255, + "mappedType": "string" + }, + "exited_at": { + "name": "exited_at", + "type": "varchar(255)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 255, + "mappedType": "string" }, "status": { "name": "status", @@ -6473,6 +6508,16 @@ "nullable": false, "length": 255, "mappedType": "string" + }, + "watcher_description": { + "name": "watcher_description", + "type": "varchar(255)", + "unsigned": false, + "autoincrement": false, + "primary": false, + "nullable": true, + "length": 255, + "mappedType": "string" } }, "name": "barname", @@ -6524,7 +6569,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -6766,7 +6812,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -7055,7 +7102,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -7285,7 +7333,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { @@ -7401,7 +7450,8 @@ "schema": "public", "items": [ "ADMIN", - "USER" + "USER", + "WATCHER" ] }, "notif_type": { diff --git a/database/migrations/Migration20260307111844.ts b/database/migrations/Migration20260307111844.ts new file mode 100644 index 0000000..8a43c22 --- /dev/null +++ b/database/migrations/Migration20260307111844.ts @@ -0,0 +1,16 @@ +import { Migration } from '@mikro-orm/migrations'; + +export class Migration20260307111844 extends Migration { + + override async up(): Promise { + this.addSql(`alter type "role_enum" add value if not exists 'WATCHER' after 'USER';`); + + this.addSql(`alter table "barname" add column "exited_at" varchar(255) null, add column "watcher_description" varchar(255) null;`); + this.addSql(`alter table "barname" alter column "exit_at" type varchar(255) using ("exit_at"::varchar(255));`); + } + + override async down(): Promise { + this.addSql(`alter table "barname" alter column "exit_at" type timestamptz using ("exit_at"::timestamptz);`); + } + +}