aboutsummaryrefslogtreecommitdiff
path: root/migrations/20220128020826_remove_prefix_from_setting/migration.sql
diff options
context:
space:
mode:
Diffstat (limited to 'migrations/20220128020826_remove_prefix_from_setting/migration.sql')
-rw-r--r--migrations/20220128020826_remove_prefix_from_setting/migration.sql21
1 files changed, 21 insertions, 0 deletions
diff --git a/migrations/20220128020826_remove_prefix_from_setting/migration.sql b/migrations/20220128020826_remove_prefix_from_setting/migration.sql
new file mode 100644
index 0000000..c06286b
--- /dev/null
+++ b/migrations/20220128020826_remove_prefix_from_setting/migration.sql
@@ -0,0 +1,21 @@
+/*
+ Warnings:
+
+ - You are about to drop the column `finishedSetup` on the `Setting` table. All the data in the column will be lost.
+ - You are about to drop the column `prefix` on the `Setting` table. All the data in the column will be lost.
+
+*/
+-- RedefineTables
+PRAGMA foreign_keys=OFF;
+CREATE TABLE "new_Setting" (
+ "guildId" TEXT NOT NULL PRIMARY KEY,
+ "channel" TEXT,
+ "playlistLimit" INTEGER NOT NULL DEFAULT 50,
+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" DATETIME NOT NULL
+);
+INSERT INTO "new_Setting" ("channel", "createdAt", "guildId", "playlistLimit", "updatedAt") SELECT "channel", "createdAt", "guildId", "playlistLimit", "updatedAt" FROM "Setting";
+DROP TABLE "Setting";
+ALTER TABLE "new_Setting" RENAME TO "Setting";
+PRAGMA foreign_key_check;
+PRAGMA foreign_keys=ON;