mirror of
https://github.com/aljazceru/nsecbunkerd.git
synced 2025-12-17 06:04:22 +01:00
store requests
This commit is contained in:
8
prisma/migrations/20231105090854_request/migration.sql
Normal file
8
prisma/migrations/20231105090854_request/migration.sql
Normal file
@@ -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
|
||||
);
|
||||
22
prisma/migrations/20231105091736_method/migration.sql
Normal file
22
prisma/migrations/20231105091736_method/migration.sql
Normal file
@@ -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;
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user