noteshare.space/server/prisma/migrations/20220619173843_bytesarenowstrings/migration.sql
Maxime Cannoodt cc9653d464 reordering
2022-06-21 23:30:11 +02:00

14 lines
538 B
SQL

-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_EncryptedNote" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"insert_time" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"ciphertext" TEXT NOT NULL,
"hmac" TEXT NOT NULL
);
INSERT INTO "new_EncryptedNote" ("ciphertext", "hmac", "id", "insert_time") SELECT "ciphertext", "hmac", "id", "insert_time" FROM "EncryptedNote";
DROP TABLE "EncryptedNote";
ALTER TABLE "new_EncryptedNote" RENAME TO "EncryptedNote";
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;