-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b06854a
commit 6e40325
Showing
4 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
prisma/migrations/20231209201853_remove_editable/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `editable` on the `Connection` table. All the data in the column will be lost. | ||
*/ | ||
-- RedefineTables | ||
PRAGMA foreign_keys=OFF; | ||
CREATE TABLE "new_Connection" ( | ||
"alias" TEXT NOT NULL PRIMARY KEY, | ||
"created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updated" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"description" TEXT, | ||
"connectionString" TEXT NOT NULL, | ||
"driver" TEXT NOT NULL | ||
); | ||
INSERT INTO "new_Connection" ("alias", "connectionString", "created", "description", "driver", "updated") SELECT "alias", "connectionString", "created", "description", "driver", "updated" FROM "Connection"; | ||
DROP TABLE "Connection"; | ||
ALTER TABLE "new_Connection" RENAME TO "Connection"; | ||
CREATE UNIQUE INDEX "Connection_alias_key" ON "Connection"("alias"); | ||
CREATE TABLE "new_History" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"lastUsed" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"count" INTEGER NOT NULL DEFAULT 1, | ||
"query" TEXT NOT NULL, | ||
"connectionAlias" TEXT NOT NULL, | ||
"success" BOOLEAN NOT NULL, | ||
CONSTRAINT "History_connectionAlias_fkey" FOREIGN KEY ("connectionAlias") REFERENCES "Connection" ("alias") ON DELETE CASCADE ON UPDATE CASCADE | ||
); | ||
INSERT INTO "new_History" ("connectionAlias", "count", "created", "id", "lastUsed", "query", "success") SELECT "connectionAlias", "count", "created", "id", "lastUsed", "query", "success" FROM "History"; | ||
DROP TABLE "History"; | ||
ALTER TABLE "new_History" RENAME TO "History"; | ||
CREATE UNIQUE INDEX "History_query_connectionAlias_key" ON "History"("query", "connectionAlias"); | ||
PRAGMA foreign_key_check; | ||
PRAGMA foreign_keys=ON; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters