sanity checking, do not duplicate responses
This commit is contained in:
		| @ -0,0 +1,18 @@ | ||||
| -- RedefineTables | ||||
| PRAGMA defer_foreign_keys=ON; | ||||
| PRAGMA foreign_keys=OFF; | ||||
| CREATE TABLE "new_Response" ( | ||||
|     "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||||
|     "pleromaNotificationId" TEXT NOT NULL DEFAULT 'null', | ||||
|     "to" TEXT NOT NULL, | ||||
|     "request" TEXT, | ||||
|     "response" TEXT, | ||||
|     "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||||
|     "processedAt" DATETIME, | ||||
|     "isProcessing" BOOLEAN NOT NULL DEFAULT true | ||||
| ); | ||||
| INSERT INTO "new_Response" ("createdAt", "id", "pleromaNotificationId", "processedAt", "request", "response", "to") SELECT "createdAt", "id", "pleromaNotificationId", "processedAt", "request", "response", "to" FROM "Response"; | ||||
| DROP TABLE "Response"; | ||||
| ALTER TABLE "new_Response" RENAME TO "Response"; | ||||
| PRAGMA foreign_keys=ON; | ||||
| PRAGMA defer_foreign_keys=OFF; | ||||
| @ -0,0 +1,18 @@ | ||||
| -- RedefineTables | ||||
| PRAGMA defer_foreign_keys=ON; | ||||
| PRAGMA foreign_keys=OFF; | ||||
| CREATE TABLE "new_Response" ( | ||||
|     "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||||
|     "pleromaNotificationId" TEXT NOT NULL DEFAULT 'null', | ||||
|     "to" TEXT NOT NULL DEFAULT 'null', | ||||
|     "request" TEXT NOT NULL DEFAULT 'null', | ||||
|     "response" TEXT NOT NULL DEFAULT 'null', | ||||
|     "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||||
|     "processedAt" DATETIME, | ||||
|     "isProcessing" BOOLEAN NOT NULL DEFAULT true | ||||
| ); | ||||
| INSERT INTO "new_Response" ("createdAt", "id", "isProcessing", "pleromaNotificationId", "processedAt", "request", "response", "to") SELECT "createdAt", "id", "isProcessing", "pleromaNotificationId", "processedAt", coalesce("request", 'null') AS "request", coalesce("response", 'null') AS "response", "to" FROM "Response"; | ||||
| DROP TABLE "Response"; | ||||
| ALTER TABLE "new_Response" RENAME TO "Response"; | ||||
| PRAGMA foreign_keys=ON; | ||||
| PRAGMA defer_foreign_keys=OFF; | ||||
| @ -14,11 +14,12 @@ datasource db { | ||||
| model Response { | ||||
|   id                    Int       @id @default(autoincrement()) | ||||
|   pleromaNotificationId String    @default("null") | ||||
|   to                    String | ||||
|   request               String? | ||||
|   response              String? | ||||
|   to                    String    @default("null") | ||||
|   request               String    @default("null") | ||||
|   response              String    @default("null") | ||||
|   createdAt             DateTime  @default(now()) | ||||
|   processedAt           DateTime? | ||||
|   isProcessing          Boolean   @default(true) | ||||
| } | ||||
|  | ||||
| model User { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user