diff --git a/src/officesense_pi/prisma/migrations/20260514162920_add_room_entity/migration.sql b/src/officesense_pi/prisma/migrations/20260514162920_add_room_entity/migration.sql new file mode 100644 index 0000000..00af0a9 --- /dev/null +++ b/src/officesense_pi/prisma/migrations/20260514162920_add_room_entity/migration.sql @@ -0,0 +1,20 @@ +-- CreateTable +CREATE TABLE "Room" ( + "id" TEXT NOT NULL PRIMARY KEY, + "nameame" TEXT NOT NULL +); + +-- RedefineTables +PRAGMA defer_foreign_keys=ON; +PRAGMA foreign_keys=OFF; +CREATE TABLE "new_User" ( + "id" TEXT NOT NULL PRIMARY KEY, + "firstName" TEXT NOT NULL, + "lastName" TEXT NOT NULL, + "faceEmbedding" BLOB +); +INSERT INTO "new_User" ("faceEmbedding", "firstName", "id", "lastName") SELECT "faceEmbedding", "firstName", "id", "lastName" FROM "User"; +DROP TABLE "User"; +ALTER TABLE "new_User" RENAME TO "User"; +PRAGMA foreign_keys=ON; +PRAGMA defer_foreign_keys=OFF; diff --git a/src/officesense_pi/prisma/migrations/20260514174139_room_name_typo/migration.sql b/src/officesense_pi/prisma/migrations/20260514174139_room_name_typo/migration.sql new file mode 100644 index 0000000..a0c23a7 --- /dev/null +++ b/src/officesense_pi/prisma/migrations/20260514174139_room_name_typo/migration.sql @@ -0,0 +1,19 @@ +/* + Warnings: + + - You are about to drop the column `nameame` on the `Room` table. All the data in the column will be lost. + - Added the required column `name` to the `Room` table without a default value. This is not possible if the table is not empty. + +*/ +-- RedefineTables +PRAGMA defer_foreign_keys=ON; +PRAGMA foreign_keys=OFF; +CREATE TABLE "new_Room" ( + "id" TEXT NOT NULL PRIMARY KEY, + "name" TEXT NOT NULL +); +INSERT INTO "new_Room" ("id") SELECT "id" FROM "Room"; +DROP TABLE "Room"; +ALTER TABLE "new_Room" RENAME TO "Room"; +PRAGMA foreign_keys=ON; +PRAGMA defer_foreign_keys=OFF;