21 lines
718 B
SQL
21 lines
718 B
SQL
/*
|
|
Warnings:
|
|
|
|
- Made the column `sessionId` on table `File` required. This step will fail if there are existing NULL values in that column.
|
|
|
|
*/
|
|
-- RedefineTables
|
|
PRAGMA foreign_keys=OFF;
|
|
CREATE TABLE "new_File" (
|
|
"id" TEXT NOT NULL PRIMARY KEY,
|
|
"filename" TEXT NOT NULL,
|
|
"timestamp" BIGINT NOT NULL,
|
|
"sessionId" TEXT NOT NULL,
|
|
CONSTRAINT "File_sessionId_fkey" FOREIGN KEY ("sessionId") REFERENCES "Session" ("id") ON DELETE CASCADE ON UPDATE CASCADE
|
|
);
|
|
INSERT INTO "new_File" ("filename", "id", "sessionId", "timestamp") SELECT "filename", "id", "sessionId", "timestamp" FROM "File";
|
|
DROP TABLE "File";
|
|
ALTER TABLE "new_File" RENAME TO "File";
|
|
PRAGMA foreign_key_check;
|
|
PRAGMA foreign_keys=ON;
|