diff --git a/prisma/migrations/20231105090854_request/migration.sql b/prisma/migrations/20231105090854_request/migration.sql new file mode 100644 index 0000000..9918975 --- /dev/null +++ b/prisma/migrations/20231105090854_request/migration.sql @@ -0,0 +1,8 @@ +-- CreateTable +CREATE TABLE "Request" ( + "id" TEXT NOT NULL PRIMARY KEY, + "keyName" TEXT NOT NULL, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "requestId" TEXT NOT NULL, + "remotePubkey" TEXT NOT NULL +); diff --git a/prisma/migrations/20231105091736_method/migration.sql b/prisma/migrations/20231105091736_method/migration.sql new file mode 100644 index 0000000..dd58115 --- /dev/null +++ b/prisma/migrations/20231105091736_method/migration.sql @@ -0,0 +1,22 @@ +/* + Warnings: + + - Added the required column `method` to the `Request` table without a default value. This is not possible if the table is not empty. + +*/ +-- RedefineTables +PRAGMA foreign_keys=OFF; +CREATE TABLE "new_Request" ( + "id" TEXT NOT NULL PRIMARY KEY, + "keyName" TEXT NOT NULL, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "requestId" TEXT NOT NULL, + "remotePubkey" TEXT NOT NULL, + "method" TEXT NOT NULL, + "params" TEXT +); +INSERT INTO "new_Request" ("createdAt", "id", "keyName", "remotePubkey", "requestId") SELECT "createdAt", "id", "keyName", "remotePubkey", "requestId" FROM "Request"; +DROP TABLE "Request"; +ALTER TABLE "new_Request" RENAME TO "Request"; +PRAGMA foreign_key_check; +PRAGMA foreign_keys=ON; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 91e0564..1e0fb93 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -7,6 +7,16 @@ datasource db { url = "file:../config/nsecbunker.db" } +model Request { + id String @id @default(uuid()) + keyName String + createdAt DateTime @default(now()) + requestId String + remotePubkey String + method String + params String? +} + model KeyUser { id Int @id @default(autoincrement()) keyName String