From 920d0fd2edc31cd5657af2ea952850c566b6711f Mon Sep 17 00:00:00 2001 From: Vermium Sifell Date: Sun, 23 Oct 2022 18:38:23 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Switch=20from=20SQLite=20to=20My?= =?UTF-8?q?SQL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 69 ++--- .../20221019063840_init/migration.sql | 29 --- .../20221019064232_init/migration.sql | 26 -- .../20221019081114_modules/migration.sql | 71 ----- .../20221019081816_modules/migration.sql | 35 --- .../20221019113258_modules/migration.sql | 43 --- .../20221019114543_modules/migration.sql | 45 ---- .../20221019142757_modules/migration.sql | 30 --- .../20221019153247_cooldowns/migration.sql | 13 - .../20221019153652_audit_dates/migration.sql | 155 ----------- .../20221019172846_embedconfig/migration.sql | 55 ---- .../20221020081238_cpgg_api/migration.sql | 12 - .../migration.sql | 34 --- .../20221020084922_cooldown_int/migration.sql | 40 --- .../migration.sql | 70 ----- .../20221020113312_shop_module/migration.sql | 74 ------ .../migration.sql | 79 ------ .../migration.sql | 89 ------- .../migration.sql | 91 ------- .../migration.sql | 17 -- .../migration.sql | 42 --- .../migration.sql | 39 --- .../migration.sql | 39 --- .../migration.sql | 244 ------------------ .../migration.sql | 244 ------------------ prisma/migrations/migration_lock.toml | 3 - prisma/schema.prisma | 2 +- 27 files changed, 21 insertions(+), 1669 deletions(-) delete mode 100644 prisma/migrations/20221019063840_init/migration.sql delete mode 100644 prisma/migrations/20221019064232_init/migration.sql delete mode 100644 prisma/migrations/20221019081114_modules/migration.sql delete mode 100644 prisma/migrations/20221019081816_modules/migration.sql delete mode 100644 prisma/migrations/20221019113258_modules/migration.sql delete mode 100644 prisma/migrations/20221019114543_modules/migration.sql delete mode 100644 prisma/migrations/20221019142757_modules/migration.sql delete mode 100644 prisma/migrations/20221019153247_cooldowns/migration.sql delete mode 100644 prisma/migrations/20221019153652_audit_dates/migration.sql delete mode 100644 prisma/migrations/20221019172846_embedconfig/migration.sql delete mode 100644 prisma/migrations/20221020081238_cpgg_api/migration.sql delete mode 100644 prisma/migrations/20221020084750_cooldown_string/migration.sql delete mode 100644 prisma/migrations/20221020084922_cooldown_int/migration.sql delete mode 100644 prisma/migrations/20221020111948_audits_module/migration.sql delete mode 100644 prisma/migrations/20221020113312_shop_module/migration.sql delete mode 100644 prisma/migrations/20221020113704_welcome_module/migration.sql delete mode 100644 prisma/migrations/20221020113756_welcome_module_correction/migration.sql delete mode 100644 prisma/migrations/20221020113831_welcome_module_correction/migration.sql delete mode 100644 prisma/migrations/20221021150615_shoproles_model/migration.sql delete mode 100644 prisma/migrations/20221021151136_shoproles_model_correction/migration.sql delete mode 100644 prisma/migrations/20221021151337_shoproles_model_correction/migration.sql delete mode 100644 prisma/migrations/20221021153546_shoproles_model_correction/migration.sql delete mode 100644 prisma/migrations/20221021172156_int_to_bigint/migration.sql delete mode 100644 prisma/migrations/20221021172345_bigint_to_int/migration.sql delete mode 100644 prisma/migrations/migration_lock.toml diff --git a/docker-compose.yml b/docker-compose.yml index cdffc50..596b527 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,54 +3,25 @@ version: "3.7" services: app: container_name: app - restart: always - build: . - env_file: .env + image: vermiumwastaken/xyter + restart: unless-stopped + env_file: + - .env volumes: - - ./logs:/usr/logs + - ./logs:/logs + mariadb: + image: lscr.io/linuxserver/mariadb:latest + container_name: mariadb environment: - - DATABASE_URL="file:./dev.db" - -volumes: - xyter-testdb: -# # Not working yet due to change from Mongoose to Prisma - -# version: "3" - -# services: -# app: -# image: zyner/xyter:latest -# restart: unless-stopped -# # build: . -# stdin_open: true -# tty: true -# volumes: -# - ./logs:/app/logs -# environment: -# - DISCORD_TOKEN=DISCORD_TOKEN -# - DISCORD_CLIENT_ID=DISCORD_CLIENT_ID -# - DISCORD_GUILD_ID=DISCORD_GUILD_ID -# - MONGO_URL=mongodb://MONGO_USER:MONGO_PASS@mongodb:27017/admin?retryWrites=true&w=majority -# - ENCRYPTION_ALGORITHM=ENCRYPTION_ALGORITHM -# - ENCRYPTION_SECRET=ENCRYPTION_SECRET -# - EMEBD_COLOR_SUCCESS=EMEBD_COLOR_SUCCESS -# - EMBED_COLOR_WAIT=EMBED_COLOR_WAIT -# - EMBED_COLOR_ERROR=EMBED_COLOR_ERROR -# - EMBED_FOOTER_TEXT=EMBED_FOOTER_TEXT -# - EMBED_FOOTER_ICON=EMBED_FOOTER_ICON -# - LOG_LEVEL=LOG_LEVEL -# - REPUTATION_TIMEOUT=REPUTATION_TIMEOUT -# - BOT_HOSTER_NAME=BOT_HOSTER_NAME -# - BOT_HOSTER_URL=BOT_HOSTER_URL -# - NODE_ENV=production -# depends_on: -# - mongodb - -# mongodb: -# image: mongo:latest -# restart: unless-stopped -# environment: -# MONGO_INITDB_ROOT_USERNAME: MONGO_USER -# MONGO_INITDB_ROOT_PASSWORD: MONGO_PASS -# volumes: -# - ./database:/data/db + - PUID=1000 + - PGID=1000 + - MYSQL_ROOT_PASSWORD=test + - TZ=Europe/Stockholm + - MYSQL_DATABASE=test #optional + - MYSQL_USER=test #optional + - MYSQL_PASSWORD=test #optional + volumes: + - ./db:/config + ports: + - 3306:3306 + restart: unless-stopped diff --git a/prisma/migrations/20221019063840_init/migration.sql b/prisma/migrations/20221019063840_init/migration.sql deleted file mode 100644 index d7577f0..0000000 --- a/prisma/migrations/20221019063840_init/migration.sql +++ /dev/null @@ -1,29 +0,0 @@ --- CreateTable -CREATE TABLE "Guild" ( - "id" TEXT NOT NULL -); - --- CreateTable - -CREATE TABLE "User" ( - "id" TEXT NOT NULL -); - --- CreateTable - -CREATE TABLE "GuildMember" ( - "userId" TEXT NOT NULL, - "guildId" TEXT NOT NULL -); - --- CreateIndex - -CREATE UNIQUE INDEX "Guild_id_key" ON "Guild" ("id"); - --- CreateIndex - -CREATE UNIQUE INDEX "User_id_key" ON "User" ("id"); - --- CreateIndex - -CREATE UNIQUE INDEX "GuildMember_userId_guildId_key" ON "GuildMember" ("userId", "guildId"); diff --git a/prisma/migrations/20221019064232_init/migration.sql b/prisma/migrations/20221019064232_init/migration.sql deleted file mode 100644 index 2028506..0000000 --- a/prisma/migrations/20221019064232_init/migration.sql +++ /dev/null @@ -1,26 +0,0 @@ --- RedefineTables -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_GuildMember" ( - "userId" TEXT NOT NULL, - "guildId" TEXT NOT NULL, - CONSTRAINT "GuildMember_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "GuildMember_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_GuildMember" ("guildId", "userId") -SELECT - "guildId", - "userId" -FROM - "GuildMember"; - -DROP TABLE "GuildMember"; - -ALTER TABLE "new_GuildMember" RENAME TO "GuildMember"; - -CREATE UNIQUE INDEX "GuildMember_userId_guildId_key" ON "GuildMember" ("userId", "guildId"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221019081114_modules/migration.sql b/prisma/migrations/20221019081114_modules/migration.sql deleted file mode 100644 index d20c517..0000000 --- a/prisma/migrations/20221019081114_modules/migration.sql +++ /dev/null @@ -1,71 +0,0 @@ --- AlterTable -ALTER TABLE "GuildMember" - ADD COLUMN "creditsEarned" INTEGER; - -ALTER TABLE "GuildMember" - ADD COLUMN "pointsEarned" INTEGER; - --- CreateTable - -CREATE TABLE "GuildCounter" ( - "guildId" TEXT NOT NULL, - "channelId" TEXT NOT NULL, - "word" TEXT NOT NULL, - "counter" INTEGER NOT NULL DEFAULT 0, - CONSTRAINT "GuildCounter_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - --- RedefineTables - -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_Guild" ( - "id" TEXT NOT NULL, - "creditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "creditsRate" INTEGER NOT NULL DEFAULT 1, - "creditsTimeout" INTEGER NOT NULL DEFAULT 5, - "creditsWorkRate" INTEGER NOT NULL DEFAULT 25, - "creditsWorkTimeout" INTEGER NOT NULL DEFAULT 86400, - "pointsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "pointsRate" INTEGER NOT NULL DEFAULT 1, - "pointsTimeout" INTEGER NOT NULL DEFAULT 5, - "reputationsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "countersEnabled" BOOLEAN NOT NULL DEFAULT FALSE -); - -INSERT INTO "new_Guild" ("id") -SELECT - "id" -FROM - "Guild"; - -DROP TABLE "Guild"; - -ALTER TABLE "new_Guild" RENAME TO "Guild"; - -CREATE UNIQUE INDEX "Guild_id_key" ON "Guild" ("id"); - -CREATE TABLE "new_User" ( - "id" TEXT NOT NULL, - "reputationsEarned" INTEGER NOT NULL DEFAULT 0 -); - -INSERT INTO "new_User" ("id") -SELECT - "id" -FROM - "User"; - -DROP TABLE "User"; - -ALTER TABLE "new_User" RENAME TO "User"; - -CREATE UNIQUE INDEX "User_id_key" ON "User" ("id"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; - --- CreateIndex - -CREATE UNIQUE INDEX "GuildCounter_guildId_channelId_key" ON "GuildCounter" ("guildId", "channelId"); diff --git a/prisma/migrations/20221019081816_modules/migration.sql b/prisma/migrations/20221019081816_modules/migration.sql deleted file mode 100644 index d2fcde5..0000000 --- a/prisma/migrations/20221019081816_modules/migration.sql +++ /dev/null @@ -1,35 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `counter` on the `GuildCounter` table. All the data in the column will be lost. - - You are about to drop the column `word` on the `GuildCounter` table. All the data in the column will be lost. - - Added the required column `triggerWord` to the `GuildCounter` table without a default value. This is not possible if the table is not empty. - */ --- RedefineTables - -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_GuildCounter" ( - "guildId" TEXT NOT NULL, - "channelId" TEXT NOT NULL, - "triggerWord" TEXT NOT NULL, - "count" INTEGER NOT NULL DEFAULT 0, - CONSTRAINT "GuildCounter_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_GuildCounter" ("channelId", "guildId") -SELECT - "channelId", - "guildId" -FROM - "GuildCounter"; - -DROP TABLE "GuildCounter"; - -ALTER TABLE "new_GuildCounter" RENAME TO "GuildCounter"; - -CREATE UNIQUE INDEX "GuildCounter_guildId_channelId_key" ON "GuildCounter" ("guildId", "channelId"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221019113258_modules/migration.sql b/prisma/migrations/20221019113258_modules/migration.sql deleted file mode 100644 index a22b2a3..0000000 --- a/prisma/migrations/20221019113258_modules/migration.sql +++ /dev/null @@ -1,43 +0,0 @@ --- RedefineTables -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_Guild" ( - "id" TEXT NOT NULL, - "creditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "creditsRate" INTEGER NOT NULL DEFAULT 1, - "creditsTimeout" INTEGER NOT NULL DEFAULT 5, - "creditsWorkRate" INTEGER NOT NULL DEFAULT 25, - "creditsWorkTimeout" INTEGER NOT NULL DEFAULT 86400, - "creditsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "pointsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "pointsRate" INTEGER NOT NULL DEFAULT 1, - "pointsTimeout" INTEGER NOT NULL DEFAULT 5, - "reputationsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "countersEnabled" BOOLEAN NOT NULL DEFAULT FALSE -); - -INSERT INTO "new_Guild" ("countersEnabled", "creditsEnabled", "creditsRate", "creditsTimeout", "creditsWorkRate", "creditsWorkTimeout", "id", "pointsEnabled", "pointsRate", "pointsTimeout", "reputationsEnabled") -SELECT - "countersEnabled", - "creditsEnabled", - "creditsRate", - "creditsTimeout", - "creditsWorkRate", - "creditsWorkTimeout", - "id", - "pointsEnabled", - "pointsRate", - "pointsTimeout", - "reputationsEnabled" -FROM - "Guild"; - -DROP TABLE "Guild"; - -ALTER TABLE "new_Guild" RENAME TO "Guild"; - -CREATE UNIQUE INDEX "Guild_id_key" ON "Guild" ("id"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221019114543_modules/migration.sql b/prisma/migrations/20221019114543_modules/migration.sql deleted file mode 100644 index 0d89d31..0000000 --- a/prisma/migrations/20221019114543_modules/migration.sql +++ /dev/null @@ -1,45 +0,0 @@ --- RedefineTables -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_Guild" ( - "id" TEXT NOT NULL, - "creditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "creditsRate" INTEGER NOT NULL DEFAULT 1, - "creditsTimeout" INTEGER NOT NULL DEFAULT 5, - "creditsWorkRate" INTEGER NOT NULL DEFAULT 25, - "creditsWorkTimeout" INTEGER NOT NULL DEFAULT 86400, - "creditsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "pointsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "pointsRate" INTEGER NOT NULL DEFAULT 1, - "pointsTimeout" INTEGER NOT NULL DEFAULT 5, - "pointsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "reputationsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "countersEnabled" BOOLEAN NOT NULL DEFAULT FALSE -); - -INSERT INTO "new_Guild" ("countersEnabled", "creditsEnabled", "creditsMinimumLength", "creditsRate", "creditsTimeout", "creditsWorkRate", "creditsWorkTimeout", "id", "pointsEnabled", "pointsRate", "pointsTimeout", "reputationsEnabled") -SELECT - "countersEnabled", - "creditsEnabled", - "creditsMinimumLength", - "creditsRate", - "creditsTimeout", - "creditsWorkRate", - "creditsWorkTimeout", - "id", - "pointsEnabled", - "pointsRate", - "pointsTimeout", - "reputationsEnabled" -FROM - "Guild"; - -DROP TABLE "Guild"; - -ALTER TABLE "new_Guild" RENAME TO "Guild"; - -CREATE UNIQUE INDEX "Guild_id_key" ON "Guild" ("id"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221019142757_modules/migration.sql b/prisma/migrations/20221019142757_modules/migration.sql deleted file mode 100644 index 387fb6e..0000000 --- a/prisma/migrations/20221019142757_modules/migration.sql +++ /dev/null @@ -1,30 +0,0 @@ --- RedefineTables -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_GuildMember" ( - "userId" TEXT NOT NULL, - "guildId" TEXT NOT NULL, - "creditsEarned" INTEGER NOT NULL DEFAULT 0, - "pointsEarned" INTEGER NOT NULL DEFAULT 0, - CONSTRAINT "GuildMember_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "GuildMember_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_GuildMember" ("creditsEarned", "guildId", "pointsEarned", "userId") -SELECT - coalesce("creditsEarned", 0) AS "creditsEarned", - "guildId", - coalesce("pointsEarned", 0) AS "pointsEarned", - "userId" -FROM - "GuildMember"; - -DROP TABLE "GuildMember"; - -ALTER TABLE "new_GuildMember" RENAME TO "GuildMember"; - -CREATE UNIQUE INDEX "GuildMember_userId_guildId_key" ON "GuildMember" ("userId", "guildId"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221019153247_cooldowns/migration.sql b/prisma/migrations/20221019153247_cooldowns/migration.sql deleted file mode 100644 index b85f815..0000000 --- a/prisma/migrations/20221019153247_cooldowns/migration.sql +++ /dev/null @@ -1,13 +0,0 @@ --- CreateTable -CREATE TABLE "Cooldown" ( - "guildId" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "cooldown" INTEGER NOT NULL, - "timeoutId" TEXT NOT NULL, - CONSTRAINT "Cooldown_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "Cooldown_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - --- CreateIndex - -CREATE UNIQUE INDEX "Cooldown_guildId_userId_timeoutId_key" ON "Cooldown" ("guildId", "userId", "timeoutId"); diff --git a/prisma/migrations/20221019153652_audit_dates/migration.sql b/prisma/migrations/20221019153652_audit_dates/migration.sql deleted file mode 100644 index fd40071..0000000 --- a/prisma/migrations/20221019153652_audit_dates/migration.sql +++ /dev/null @@ -1,155 +0,0 @@ -/* - Warnings: - - - Added the required column `updatedAt` to the `Guild` table without a default value. This is not possible if the table is not empty. - - Added the required column `updatedAt` to the `Cooldown` table without a default value. This is not possible if the table is not empty. - - Added the required column `updatedAt` to the `GuildCounter` table without a default value. This is not possible if the table is not empty. - - Added the required column `updatedAt` to the `User` table without a default value. This is not possible if the table is not empty. - - Added the required column `updatedAt` to the `GuildMember` table without a default value. This is not possible if the table is not empty. - */ --- RedefineTables - -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_Guild" ( - "id" TEXT NOT NULL, - "creditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "creditsRate" INTEGER NOT NULL DEFAULT 1, - "creditsTimeout" INTEGER NOT NULL DEFAULT 5, - "creditsWorkRate" INTEGER NOT NULL DEFAULT 25, - "creditsWorkTimeout" INTEGER NOT NULL DEFAULT 86400, - "creditsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "pointsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "pointsRate" INTEGER NOT NULL DEFAULT 1, - "pointsTimeout" INTEGER NOT NULL DEFAULT 5, - "pointsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "reputationsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "countersEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL -); - -INSERT INTO "new_Guild" ("countersEnabled", "creditsEnabled", "creditsMinimumLength", "creditsRate", "creditsTimeout", "creditsWorkRate", "creditsWorkTimeout", "id", "pointsEnabled", "pointsMinimumLength", "pointsRate", "pointsTimeout", "reputationsEnabled") -SELECT - "countersEnabled", - "creditsEnabled", - "creditsMinimumLength", - "creditsRate", - "creditsTimeout", - "creditsWorkRate", - "creditsWorkTimeout", - "id", - "pointsEnabled", - "pointsMinimumLength", - "pointsRate", - "pointsTimeout", - "reputationsEnabled" -FROM - "Guild"; - -DROP TABLE "Guild"; - -ALTER TABLE "new_Guild" RENAME TO "Guild"; - -CREATE UNIQUE INDEX "Guild_id_key" ON "Guild" ("id"); - -CREATE TABLE "new_Cooldown" ( - "guildId" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "cooldown" INTEGER NOT NULL, - "timeoutId" TEXT NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "Cooldown_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "Cooldown_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_Cooldown" ("cooldown", "guildId", "timeoutId", "userId") -SELECT - "cooldown", - "guildId", - "timeoutId", - "userId" -FROM - "Cooldown"; - -DROP TABLE "Cooldown"; - -ALTER TABLE "new_Cooldown" RENAME TO "Cooldown"; - -CREATE UNIQUE INDEX "Cooldown_guildId_userId_timeoutId_key" ON "Cooldown" ("guildId", "userId", "timeoutId"); - -CREATE TABLE "new_GuildCounter" ( - "guildId" TEXT NOT NULL, - "channelId" TEXT NOT NULL, - "triggerWord" TEXT NOT NULL, - "count" INTEGER NOT NULL DEFAULT 0, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "GuildCounter_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_GuildCounter" ("channelId", "count", "guildId", "triggerWord") -SELECT - "channelId", - "count", - "guildId", - "triggerWord" -FROM - "GuildCounter"; - -DROP TABLE "GuildCounter"; - -ALTER TABLE "new_GuildCounter" RENAME TO "GuildCounter"; - -CREATE UNIQUE INDEX "GuildCounter_guildId_channelId_key" ON "GuildCounter" ("guildId", "channelId"); - -CREATE TABLE "new_User" ( - "id" TEXT NOT NULL, - "reputationsEarned" INTEGER NOT NULL DEFAULT 0, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL -); - -INSERT INTO "new_User" ("id", "reputationsEarned") -SELECT - "id", - "reputationsEarned" -FROM - "User"; - -DROP TABLE "User"; - -ALTER TABLE "new_User" RENAME TO "User"; - -CREATE UNIQUE INDEX "User_id_key" ON "User" ("id"); - -CREATE TABLE "new_GuildMember" ( - "userId" TEXT NOT NULL, - "guildId" TEXT NOT NULL, - "creditsEarned" INTEGER NOT NULL DEFAULT 0, - "pointsEarned" INTEGER NOT NULL DEFAULT 0, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "GuildMember_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "GuildMember_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_GuildMember" ("creditsEarned", "guildId", "pointsEarned", "userId") -SELECT - "creditsEarned", - "guildId", - "pointsEarned", - "userId" -FROM - "GuildMember"; - -DROP TABLE "GuildMember"; - -ALTER TABLE "new_GuildMember" RENAME TO "GuildMember"; - -CREATE UNIQUE INDEX "GuildMember_userId_guildId_key" ON "GuildMember" ("userId", "guildId"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221019172846_embedconfig/migration.sql b/prisma/migrations/20221019172846_embedconfig/migration.sql deleted file mode 100644 index f404f36..0000000 --- a/prisma/migrations/20221019172846_embedconfig/migration.sql +++ /dev/null @@ -1,55 +0,0 @@ --- RedefineTables -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_Guild" ( - "id" TEXT NOT NULL, - "embedColorSuccess" TEXT NOT NULL DEFAULT '#22bb33', - "embedColorWait" TEXT NOT NULL DEFAULT '#f0ad4e', - "embedColorError" TEXT NOT NULL DEFAULT '#bb2124', - "embedFooterText" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg/xyter', - "embedFooterIcon" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg.png', - "creditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "creditsRate" INTEGER NOT NULL DEFAULT 1, - "creditsTimeout" INTEGER NOT NULL DEFAULT 5, - "creditsWorkRate" INTEGER NOT NULL DEFAULT 25, - "creditsWorkTimeout" INTEGER NOT NULL DEFAULT 86400, - "creditsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "pointsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "pointsRate" INTEGER NOT NULL DEFAULT 1, - "pointsTimeout" INTEGER NOT NULL DEFAULT 5, - "pointsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "reputationsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "countersEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL -); - -INSERT INTO "new_Guild" ("countersEnabled", "createdAt", "creditsEnabled", "creditsMinimumLength", "creditsRate", "creditsTimeout", "creditsWorkRate", "creditsWorkTimeout", "id", "pointsEnabled", "pointsMinimumLength", "pointsRate", "pointsTimeout", "reputationsEnabled", "updatedAt") -SELECT - "countersEnabled", - "createdAt", - "creditsEnabled", - "creditsMinimumLength", - "creditsRate", - "creditsTimeout", - "creditsWorkRate", - "creditsWorkTimeout", - "id", - "pointsEnabled", - "pointsMinimumLength", - "pointsRate", - "pointsTimeout", - "reputationsEnabled", - "updatedAt" -FROM - "Guild"; - -DROP TABLE "Guild"; - -ALTER TABLE "new_Guild" RENAME TO "Guild"; - -CREATE UNIQUE INDEX "Guild_id_key" ON "Guild" ("id"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221020081238_cpgg_api/migration.sql b/prisma/migrations/20221020081238_cpgg_api/migration.sql deleted file mode 100644 index 6b056d0..0000000 --- a/prisma/migrations/20221020081238_cpgg_api/migration.sql +++ /dev/null @@ -1,12 +0,0 @@ --- AlterTable -ALTER TABLE "Guild" - ADD COLUMN "apiCpggTokenContent" TEXT; - -ALTER TABLE "Guild" - ADD COLUMN "apiCpggTokenIv" TEXT; - -ALTER TABLE "Guild" - ADD COLUMN "apiCpggUrlContent" TEXT; - -ALTER TABLE "Guild" - ADD COLUMN "apiCpggUrlIv" TEXT; diff --git a/prisma/migrations/20221020084750_cooldown_string/migration.sql b/prisma/migrations/20221020084750_cooldown_string/migration.sql deleted file mode 100644 index a9521a5..0000000 --- a/prisma/migrations/20221020084750_cooldown_string/migration.sql +++ /dev/null @@ -1,34 +0,0 @@ --- RedefineTables -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_Cooldown" ( - "guildId" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "cooldown" TEXT NOT NULL, - "timeoutId" TEXT NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "Cooldown_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "Cooldown_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_Cooldown" ("cooldown", "createdAt", "guildId", "timeoutId", "updatedAt", "userId") -SELECT - "cooldown", - "createdAt", - "guildId", - "timeoutId", - "updatedAt", - "userId" -FROM - "Cooldown"; - -DROP TABLE "Cooldown"; - -ALTER TABLE "new_Cooldown" RENAME TO "Cooldown"; - -CREATE UNIQUE INDEX "Cooldown_guildId_userId_timeoutId_key" ON "Cooldown" ("guildId", "userId", "timeoutId"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221020084922_cooldown_int/migration.sql b/prisma/migrations/20221020084922_cooldown_int/migration.sql deleted file mode 100644 index 822d410..0000000 --- a/prisma/migrations/20221020084922_cooldown_int/migration.sql +++ /dev/null @@ -1,40 +0,0 @@ -/* - Warnings: - - - You are about to alter the column `cooldown` on the `Cooldown` table. The data in that column could be lost. The data in that column will be cast from `String` to `Int`. - */ --- RedefineTables - -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_Cooldown" ( - "guildId" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "cooldown" INTEGER NOT NULL, - "timeoutId" TEXT NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "Cooldown_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "Cooldown_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_Cooldown" ("cooldown", "createdAt", "guildId", "timeoutId", "updatedAt", "userId") -SELECT - "cooldown", - "createdAt", - "guildId", - "timeoutId", - "updatedAt", - "userId" -FROM - "Cooldown"; - -DROP TABLE "Cooldown"; - -ALTER TABLE "new_Cooldown" RENAME TO "Cooldown"; - -CREATE UNIQUE INDEX "Cooldown_guildId_userId_timeoutId_key" ON "Cooldown" ("guildId", "userId", "timeoutId"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221020111948_audits_module/migration.sql b/prisma/migrations/20221020111948_audits_module/migration.sql deleted file mode 100644 index c44d8b6..0000000 --- a/prisma/migrations/20221020111948_audits_module/migration.sql +++ /dev/null @@ -1,70 +0,0 @@ --- RedefineTables -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_Guild" ( - "id" TEXT NOT NULL, - "embedColorSuccess" TEXT NOT NULL DEFAULT '#22bb33', - "embedColorWait" TEXT NOT NULL DEFAULT '#f0ad4e', - "embedColorError" TEXT NOT NULL DEFAULT '#bb2124', - "embedFooterText" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg/xyter', - "embedFooterIcon" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg.png', - "creditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "creditsRate" INTEGER NOT NULL DEFAULT 1, - "creditsTimeout" INTEGER NOT NULL DEFAULT 5, - "creditsWorkRate" INTEGER NOT NULL DEFAULT 25, - "creditsWorkTimeout" INTEGER NOT NULL DEFAULT 86400, - "creditsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "pointsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "pointsRate" INTEGER NOT NULL DEFAULT 1, - "pointsTimeout" INTEGER NOT NULL DEFAULT 5, - "pointsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "reputationsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "countersEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "apiCpggUrlIv" TEXT, - "apiCpggUrlContent" TEXT, - "apiCpggTokenIv" TEXT, - "apiCpggTokenContent" TEXT, - "auditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "auditsChannelId" TEXT, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL -); - -INSERT INTO "new_Guild" ("apiCpggTokenContent", "apiCpggTokenIv", "apiCpggUrlContent", "apiCpggUrlIv", "countersEnabled", "createdAt", "creditsEnabled", "creditsMinimumLength", "creditsRate", "creditsTimeout", "creditsWorkRate", "creditsWorkTimeout", "embedColorError", "embedColorSuccess", "embedColorWait", "embedFooterIcon", "embedFooterText", "id", "pointsEnabled", "pointsMinimumLength", "pointsRate", "pointsTimeout", "reputationsEnabled", "updatedAt") -SELECT - "apiCpggTokenContent", - "apiCpggTokenIv", - "apiCpggUrlContent", - "apiCpggUrlIv", - "countersEnabled", - "createdAt", - "creditsEnabled", - "creditsMinimumLength", - "creditsRate", - "creditsTimeout", - "creditsWorkRate", - "creditsWorkTimeout", - "embedColorError", - "embedColorSuccess", - "embedColorWait", - "embedFooterIcon", - "embedFooterText", - "id", - "pointsEnabled", - "pointsMinimumLength", - "pointsRate", - "pointsTimeout", - "reputationsEnabled", - "updatedAt" -FROM - "Guild"; - -DROP TABLE "Guild"; - -ALTER TABLE "new_Guild" RENAME TO "Guild"; - -CREATE UNIQUE INDEX "Guild_id_key" ON "Guild" ("id"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221020113312_shop_module/migration.sql b/prisma/migrations/20221020113312_shop_module/migration.sql deleted file mode 100644 index 8cdbd73..0000000 --- a/prisma/migrations/20221020113312_shop_module/migration.sql +++ /dev/null @@ -1,74 +0,0 @@ --- RedefineTables -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_Guild" ( - "id" TEXT NOT NULL, - "embedColorSuccess" TEXT NOT NULL DEFAULT '#22bb33', - "embedColorWait" TEXT NOT NULL DEFAULT '#f0ad4e', - "embedColorError" TEXT NOT NULL DEFAULT '#bb2124', - "embedFooterText" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg/xyter', - "embedFooterIcon" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg.png', - "creditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "creditsRate" INTEGER NOT NULL DEFAULT 1, - "creditsTimeout" INTEGER NOT NULL DEFAULT 5, - "creditsWorkRate" INTEGER NOT NULL DEFAULT 25, - "creditsWorkTimeout" INTEGER NOT NULL DEFAULT 86400, - "creditsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "pointsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "pointsRate" INTEGER NOT NULL DEFAULT 1, - "pointsTimeout" INTEGER NOT NULL DEFAULT 5, - "pointsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "reputationsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "countersEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "apiCpggUrlIv" TEXT, - "apiCpggUrlContent" TEXT, - "apiCpggTokenIv" TEXT, - "apiCpggTokenContent" TEXT, - "auditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "auditsChannelId" TEXT, - "shopRolesEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "shopRolesPricePerHour" INTEGER NOT NULL DEFAULT 5, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL -); - -INSERT INTO "new_Guild" ("apiCpggTokenContent", "apiCpggTokenIv", "apiCpggUrlContent", "apiCpggUrlIv", "auditsChannelId", "auditsEnabled", "countersEnabled", "createdAt", "creditsEnabled", "creditsMinimumLength", "creditsRate", "creditsTimeout", "creditsWorkRate", "creditsWorkTimeout", "embedColorError", "embedColorSuccess", "embedColorWait", "embedFooterIcon", "embedFooterText", "id", "pointsEnabled", "pointsMinimumLength", "pointsRate", "pointsTimeout", "reputationsEnabled", "updatedAt") -SELECT - "apiCpggTokenContent", - "apiCpggTokenIv", - "apiCpggUrlContent", - "apiCpggUrlIv", - "auditsChannelId", - "auditsEnabled", - "countersEnabled", - "createdAt", - "creditsEnabled", - "creditsMinimumLength", - "creditsRate", - "creditsTimeout", - "creditsWorkRate", - "creditsWorkTimeout", - "embedColorError", - "embedColorSuccess", - "embedColorWait", - "embedFooterIcon", - "embedFooterText", - "id", - "pointsEnabled", - "pointsMinimumLength", - "pointsRate", - "pointsTimeout", - "reputationsEnabled", - "updatedAt" -FROM - "Guild"; - -DROP TABLE "Guild"; - -ALTER TABLE "new_Guild" RENAME TO "Guild"; - -CREATE UNIQUE INDEX "Guild_id_key" ON "Guild" ("id"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221020113704_welcome_module/migration.sql b/prisma/migrations/20221020113704_welcome_module/migration.sql deleted file mode 100644 index 7d5c6c5..0000000 --- a/prisma/migrations/20221020113704_welcome_module/migration.sql +++ /dev/null @@ -1,79 +0,0 @@ --- RedefineTables -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_Guild" ( - "id" TEXT NOT NULL, - "embedColorSuccess" TEXT NOT NULL DEFAULT '#22bb33', - "embedColorWait" TEXT NOT NULL DEFAULT '#f0ad4e', - "embedColorError" TEXT NOT NULL DEFAULT '#bb2124', - "embedFooterText" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg/xyter', - "embedFooterIcon" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg.png', - "creditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "creditsRate" INTEGER NOT NULL DEFAULT 1, - "creditsTimeout" INTEGER NOT NULL DEFAULT 5, - "creditsWorkRate" INTEGER NOT NULL DEFAULT 25, - "creditsWorkTimeout" INTEGER NOT NULL DEFAULT 86400, - "creditsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "pointsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "pointsRate" INTEGER NOT NULL DEFAULT 1, - "pointsTimeout" INTEGER NOT NULL DEFAULT 5, - "pointsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "reputationsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "countersEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "apiCpggUrlIv" TEXT, - "apiCpggUrlContent" TEXT, - "apiCpggTokenIv" TEXT, - "apiCpggTokenContent" TEXT, - "auditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "auditsChannelId" TEXT, - "shopRolesEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "shopRolesPricePerHour" INTEGER NOT NULL DEFAULT 5, - "welcomeEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "welcomeJoinChannelId" TEXT, - "welcomejoinChannelMessahe" TEXT, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL -); - -INSERT INTO "new_Guild" ("apiCpggTokenContent", "apiCpggTokenIv", "apiCpggUrlContent", "apiCpggUrlIv", "auditsChannelId", "auditsEnabled", "countersEnabled", "createdAt", "creditsEnabled", "creditsMinimumLength", "creditsRate", "creditsTimeout", "creditsWorkRate", "creditsWorkTimeout", "embedColorError", "embedColorSuccess", "embedColorWait", "embedFooterIcon", "embedFooterText", "id", "pointsEnabled", "pointsMinimumLength", "pointsRate", "pointsTimeout", "reputationsEnabled", "shopRolesEnabled", "shopRolesPricePerHour", "updatedAt") -SELECT - "apiCpggTokenContent", - "apiCpggTokenIv", - "apiCpggUrlContent", - "apiCpggUrlIv", - "auditsChannelId", - "auditsEnabled", - "countersEnabled", - "createdAt", - "creditsEnabled", - "creditsMinimumLength", - "creditsRate", - "creditsTimeout", - "creditsWorkRate", - "creditsWorkTimeout", - "embedColorError", - "embedColorSuccess", - "embedColorWait", - "embedFooterIcon", - "embedFooterText", - "id", - "pointsEnabled", - "pointsMinimumLength", - "pointsRate", - "pointsTimeout", - "reputationsEnabled", - "shopRolesEnabled", - "shopRolesPricePerHour", - "updatedAt" -FROM - "Guild"; - -DROP TABLE "Guild"; - -ALTER TABLE "new_Guild" RENAME TO "Guild"; - -CREATE UNIQUE INDEX "Guild_id_key" ON "Guild" ("id"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221020113756_welcome_module_correction/migration.sql b/prisma/migrations/20221020113756_welcome_module_correction/migration.sql deleted file mode 100644 index 1035421..0000000 --- a/prisma/migrations/20221020113756_welcome_module_correction/migration.sql +++ /dev/null @@ -1,89 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `welcomejoinChannelMessahe` on the `Guild` table. All the data in the column will be lost. - */ --- RedefineTables - -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_Guild" ( - "id" TEXT NOT NULL, - "embedColorSuccess" TEXT NOT NULL DEFAULT '#22bb33', - "embedColorWait" TEXT NOT NULL DEFAULT '#f0ad4e', - "embedColorError" TEXT NOT NULL DEFAULT '#bb2124', - "embedFooterText" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg/xyter', - "embedFooterIcon" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg.png', - "creditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "creditsRate" INTEGER NOT NULL DEFAULT 1, - "creditsTimeout" INTEGER NOT NULL DEFAULT 5, - "creditsWorkRate" INTEGER NOT NULL DEFAULT 25, - "creditsWorkTimeout" INTEGER NOT NULL DEFAULT 86400, - "creditsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "pointsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "pointsRate" INTEGER NOT NULL DEFAULT 1, - "pointsTimeout" INTEGER NOT NULL DEFAULT 5, - "pointsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "reputationsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "countersEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "apiCpggUrlIv" TEXT, - "apiCpggUrlContent" TEXT, - "apiCpggTokenIv" TEXT, - "apiCpggTokenContent" TEXT, - "auditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "auditsChannelId" TEXT, - "shopRolesEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "shopRolesPricePerHour" INTEGER NOT NULL DEFAULT 5, - "welcomeEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "welcomeJoinChannelId" TEXT, - "welcomeJoinChannelMessahe" TEXT, - "welcomeLeaveChannelId" TEXT, - "welcomeLeaveChannelMessage" TEXT, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL -); - -INSERT INTO "new_Guild" ("apiCpggTokenContent", "apiCpggTokenIv", "apiCpggUrlContent", "apiCpggUrlIv", "auditsChannelId", "auditsEnabled", "countersEnabled", "createdAt", "creditsEnabled", "creditsMinimumLength", "creditsRate", "creditsTimeout", "creditsWorkRate", "creditsWorkTimeout", "embedColorError", "embedColorSuccess", "embedColorWait", "embedFooterIcon", "embedFooterText", "id", "pointsEnabled", "pointsMinimumLength", "pointsRate", "pointsTimeout", "reputationsEnabled", "shopRolesEnabled", "shopRolesPricePerHour", "updatedAt", "welcomeEnabled", "welcomeJoinChannelId") -SELECT - "apiCpggTokenContent", - "apiCpggTokenIv", - "apiCpggUrlContent", - "apiCpggUrlIv", - "auditsChannelId", - "auditsEnabled", - "countersEnabled", - "createdAt", - "creditsEnabled", - "creditsMinimumLength", - "creditsRate", - "creditsTimeout", - "creditsWorkRate", - "creditsWorkTimeout", - "embedColorError", - "embedColorSuccess", - "embedColorWait", - "embedFooterIcon", - "embedFooterText", - "id", - "pointsEnabled", - "pointsMinimumLength", - "pointsRate", - "pointsTimeout", - "reputationsEnabled", - "shopRolesEnabled", - "shopRolesPricePerHour", - "updatedAt", - "welcomeEnabled", - "welcomeJoinChannelId" -FROM - "Guild"; - -DROP TABLE "Guild"; - -ALTER TABLE "new_Guild" RENAME TO "Guild"; - -CREATE UNIQUE INDEX "Guild_id_key" ON "Guild" ("id"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221020113831_welcome_module_correction/migration.sql b/prisma/migrations/20221020113831_welcome_module_correction/migration.sql deleted file mode 100644 index 0c05518..0000000 --- a/prisma/migrations/20221020113831_welcome_module_correction/migration.sql +++ /dev/null @@ -1,91 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `welcomeJoinChannelMessahe` on the `Guild` table. All the data in the column will be lost. - */ --- RedefineTables - -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_Guild" ( - "id" TEXT NOT NULL, - "embedColorSuccess" TEXT NOT NULL DEFAULT '#22bb33', - "embedColorWait" TEXT NOT NULL DEFAULT '#f0ad4e', - "embedColorError" TEXT NOT NULL DEFAULT '#bb2124', - "embedFooterText" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg/xyter', - "embedFooterIcon" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg.png', - "creditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "creditsRate" INTEGER NOT NULL DEFAULT 1, - "creditsTimeout" INTEGER NOT NULL DEFAULT 5, - "creditsWorkRate" INTEGER NOT NULL DEFAULT 25, - "creditsWorkTimeout" INTEGER NOT NULL DEFAULT 86400, - "creditsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "pointsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "pointsRate" INTEGER NOT NULL DEFAULT 1, - "pointsTimeout" INTEGER NOT NULL DEFAULT 5, - "pointsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "reputationsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "countersEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "apiCpggUrlIv" TEXT, - "apiCpggUrlContent" TEXT, - "apiCpggTokenIv" TEXT, - "apiCpggTokenContent" TEXT, - "auditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "auditsChannelId" TEXT, - "shopRolesEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "shopRolesPricePerHour" INTEGER NOT NULL DEFAULT 5, - "welcomeEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "welcomeJoinChannelId" TEXT, - "welcomeJoinChannelMessage" TEXT, - "welcomeLeaveChannelId" TEXT, - "welcomeLeaveChannelMessage" TEXT, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL -); - -INSERT INTO "new_Guild" ("apiCpggTokenContent", "apiCpggTokenIv", "apiCpggUrlContent", "apiCpggUrlIv", "auditsChannelId", "auditsEnabled", "countersEnabled", "createdAt", "creditsEnabled", "creditsMinimumLength", "creditsRate", "creditsTimeout", "creditsWorkRate", "creditsWorkTimeout", "embedColorError", "embedColorSuccess", "embedColorWait", "embedFooterIcon", "embedFooterText", "id", "pointsEnabled", "pointsMinimumLength", "pointsRate", "pointsTimeout", "reputationsEnabled", "shopRolesEnabled", "shopRolesPricePerHour", "updatedAt", "welcomeEnabled", "welcomeJoinChannelId", "welcomeLeaveChannelId", "welcomeLeaveChannelMessage") -SELECT - "apiCpggTokenContent", - "apiCpggTokenIv", - "apiCpggUrlContent", - "apiCpggUrlIv", - "auditsChannelId", - "auditsEnabled", - "countersEnabled", - "createdAt", - "creditsEnabled", - "creditsMinimumLength", - "creditsRate", - "creditsTimeout", - "creditsWorkRate", - "creditsWorkTimeout", - "embedColorError", - "embedColorSuccess", - "embedColorWait", - "embedFooterIcon", - "embedFooterText", - "id", - "pointsEnabled", - "pointsMinimumLength", - "pointsRate", - "pointsTimeout", - "reputationsEnabled", - "shopRolesEnabled", - "shopRolesPricePerHour", - "updatedAt", - "welcomeEnabled", - "welcomeJoinChannelId", - "welcomeLeaveChannelId", - "welcomeLeaveChannelMessage" -FROM - "Guild"; - -DROP TABLE "Guild"; - -ALTER TABLE "new_Guild" RENAME TO "Guild"; - -CREATE UNIQUE INDEX "Guild_id_key" ON "Guild" ("id"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221021150615_shoproles_model/migration.sql b/prisma/migrations/20221021150615_shoproles_model/migration.sql deleted file mode 100644 index 3d9bab2..0000000 --- a/prisma/migrations/20221021150615_shoproles_model/migration.sql +++ /dev/null @@ -1,17 +0,0 @@ --- CreateTable -CREATE TABLE "GuildShopRoles" ( - "guildId" TEXT NOT NULL, - "channelId" TEXT NOT NULL, - "roleId" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "pricePerHour" INTEGER NOT NULL DEFAULT 5, - "lastPayed" DATETIME NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "GuildShopRoles_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "GuildShopRoles_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - --- CreateIndex - -CREATE UNIQUE INDEX "GuildShopRoles_guildId_channelId_key" ON "GuildShopRoles" ("guildId", "channelId"); diff --git a/prisma/migrations/20221021151136_shoproles_model_correction/migration.sql b/prisma/migrations/20221021151136_shoproles_model_correction/migration.sql deleted file mode 100644 index f3a4e3a..0000000 --- a/prisma/migrations/20221021151136_shoproles_model_correction/migration.sql +++ /dev/null @@ -1,42 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `channelId` on the `GuildShopRoles` table. All the data in the column will be lost. - */ --- RedefineTables - -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_GuildShopRoles" ( - "guildId" TEXT NOT NULL, - "roleId" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "pricePerHour" INTEGER NOT NULL DEFAULT 5, - "lastPayed" DATETIME NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "GuildShopRoles_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "GuildShopRoles_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_GuildShopRoles" ("createdAt", "guildId", "lastPayed", "pricePerHour", "roleId", "updatedAt", "userId") -SELECT - "createdAt", - "guildId", - "lastPayed", - "pricePerHour", - "roleId", - "updatedAt", - "userId" -FROM - "GuildShopRoles"; - -DROP TABLE "GuildShopRoles"; - -ALTER TABLE "new_GuildShopRoles" RENAME TO "GuildShopRoles"; - -CREATE UNIQUE INDEX "GuildShopRoles_guildId_userId_roleId_key" ON "GuildShopRoles" ("guildId", "userId", "roleId"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221021151337_shoproles_model_correction/migration.sql b/prisma/migrations/20221021151337_shoproles_model_correction/migration.sql deleted file mode 100644 index 52dc513..0000000 --- a/prisma/migrations/20221021151337_shoproles_model_correction/migration.sql +++ /dev/null @@ -1,39 +0,0 @@ --- RedefineTables -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_GuildShopRoles" ( - "guildId" TEXT NOT NULL, - "roleId" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "pricePerHour" INTEGER NOT NULL DEFAULT 5, - "lastPayed" DATETIME NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "GuildShopRoles_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "GuildShopRoles_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "GuildShopRoles_guildId_userId_fkey" FOREIGN KEY ("guildId", - "userId") REFERENCES "GuildMember" ("guildId", - "userId") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_GuildShopRoles" ("createdAt", "guildId", "lastPayed", "pricePerHour", "roleId", "updatedAt", "userId") -SELECT - "createdAt", - "guildId", - "lastPayed", - "pricePerHour", - "roleId", - "updatedAt", - "userId" -FROM - "GuildShopRoles"; - -DROP TABLE "GuildShopRoles"; - -ALTER TABLE "new_GuildShopRoles" RENAME TO "GuildShopRoles"; - -CREATE UNIQUE INDEX "GuildShopRoles_guildId_userId_roleId_key" ON "GuildShopRoles" ("guildId", "userId", "roleId"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221021153546_shoproles_model_correction/migration.sql b/prisma/migrations/20221021153546_shoproles_model_correction/migration.sql deleted file mode 100644 index 555cf58..0000000 --- a/prisma/migrations/20221021153546_shoproles_model_correction/migration.sql +++ /dev/null @@ -1,39 +0,0 @@ --- RedefineTables -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_GuildShopRoles" ( - "guildId" TEXT NOT NULL, - "roleId" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "pricePerHour" INTEGER NOT NULL DEFAULT 5, - "lastPayed" DATETIME NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "GuildShopRoles_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "GuildShopRoles_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "GuildShopRoles_userId_guildId_fkey" FOREIGN KEY ("userId", - "guildId") REFERENCES "GuildMember" ("userId", - "guildId") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_GuildShopRoles" ("createdAt", "guildId", "lastPayed", "pricePerHour", "roleId", "updatedAt", "userId") -SELECT - "createdAt", - "guildId", - "lastPayed", - "pricePerHour", - "roleId", - "updatedAt", - "userId" -FROM - "GuildShopRoles"; - -DROP TABLE "GuildShopRoles"; - -ALTER TABLE "new_GuildShopRoles" RENAME TO "GuildShopRoles"; - -CREATE UNIQUE INDEX "GuildShopRoles_guildId_userId_roleId_key" ON "GuildShopRoles" ("guildId", "userId", "roleId"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221021172156_int_to_bigint/migration.sql b/prisma/migrations/20221021172156_int_to_bigint/migration.sql deleted file mode 100644 index 8ba2555..0000000 --- a/prisma/migrations/20221021172156_int_to_bigint/migration.sql +++ /dev/null @@ -1,244 +0,0 @@ -/* - Warnings: - - - You are about to alter the column `count` on the `GuildCounter` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`. - - You are about to alter the column `creditsEarned` on the `GuildMember` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`. - - You are about to alter the column `pointsEarned` on the `GuildMember` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`. - - You are about to alter the column `pricePerHour` on the `GuildShopRoles` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`. - - You are about to alter the column `cooldown` on the `Cooldown` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`. - - You are about to alter the column `creditsMinimumLength` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`. - - You are about to alter the column `creditsRate` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`. - - You are about to alter the column `creditsTimeout` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`. - - You are about to alter the column `creditsWorkRate` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`. - - You are about to alter the column `creditsWorkTimeout` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`. - - You are about to alter the column `pointsMinimumLength` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`. - - You are about to alter the column `pointsRate` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`. - - You are about to alter the column `pointsTimeout` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`. - - You are about to alter the column `shopRolesPricePerHour` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`. - - You are about to alter the column `reputationsEarned` on the `User` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`. - */ --- RedefineTables - -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_GuildCounter" ( - "guildId" TEXT NOT NULL, - "channelId" TEXT NOT NULL, - "triggerWord" TEXT NOT NULL, - "count" BIGINT NOT NULL DEFAULT 0, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "GuildCounter_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_GuildCounter" ("channelId", "count", "createdAt", "guildId", "triggerWord", "updatedAt") -SELECT - "channelId", - "count", - "createdAt", - "guildId", - "triggerWord", - "updatedAt" -FROM - "GuildCounter"; - -DROP TABLE "GuildCounter"; - -ALTER TABLE "new_GuildCounter" RENAME TO "GuildCounter"; - -CREATE UNIQUE INDEX "GuildCounter_guildId_channelId_key" ON "GuildCounter" ("guildId", "channelId"); - -CREATE TABLE "new_GuildMember" ( - "userId" TEXT NOT NULL, - "guildId" TEXT NOT NULL, - "creditsEarned" BIGINT NOT NULL DEFAULT 0, - "pointsEarned" BIGINT NOT NULL DEFAULT 0, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "GuildMember_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "GuildMember_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_GuildMember" ("createdAt", "creditsEarned", "guildId", "pointsEarned", "updatedAt", "userId") -SELECT - "createdAt", - "creditsEarned", - "guildId", - "pointsEarned", - "updatedAt", - "userId" -FROM - "GuildMember"; - -DROP TABLE "GuildMember"; - -ALTER TABLE "new_GuildMember" RENAME TO "GuildMember"; - -CREATE UNIQUE INDEX "GuildMember_userId_guildId_key" ON "GuildMember" ("userId", "guildId"); - -CREATE TABLE "new_GuildShopRoles" ( - "guildId" TEXT NOT NULL, - "roleId" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "pricePerHour" BIGINT NOT NULL DEFAULT 5, - "lastPayed" DATETIME NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "GuildShopRoles_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "GuildShopRoles_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "GuildShopRoles_userId_guildId_fkey" FOREIGN KEY ("userId", - "guildId") REFERENCES "GuildMember" ("userId", - "guildId") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_GuildShopRoles" ("createdAt", "guildId", "lastPayed", "pricePerHour", "roleId", "updatedAt", "userId") -SELECT - "createdAt", - "guildId", - "lastPayed", - "pricePerHour", - "roleId", - "updatedAt", - "userId" -FROM - "GuildShopRoles"; - -DROP TABLE "GuildShopRoles"; - -ALTER TABLE "new_GuildShopRoles" RENAME TO "GuildShopRoles"; - -CREATE UNIQUE INDEX "GuildShopRoles_guildId_userId_roleId_key" ON "GuildShopRoles" ("guildId", "userId", "roleId"); - -CREATE TABLE "new_Cooldown" ( - "guildId" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "cooldown" BIGINT NOT NULL, - "timeoutId" TEXT NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "Cooldown_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "Cooldown_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_Cooldown" ("cooldown", "createdAt", "guildId", "timeoutId", "updatedAt", "userId") -SELECT - "cooldown", - "createdAt", - "guildId", - "timeoutId", - "updatedAt", - "userId" -FROM - "Cooldown"; - -DROP TABLE "Cooldown"; - -ALTER TABLE "new_Cooldown" RENAME TO "Cooldown"; - -CREATE UNIQUE INDEX "Cooldown_guildId_userId_timeoutId_key" ON "Cooldown" ("guildId", "userId", "timeoutId"); - -CREATE TABLE "new_Guild" ( - "id" TEXT NOT NULL, - "embedColorSuccess" TEXT NOT NULL DEFAULT '#22bb33', - "embedColorWait" TEXT NOT NULL DEFAULT '#f0ad4e', - "embedColorError" TEXT NOT NULL DEFAULT '#bb2124', - "embedFooterText" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg/xyter', - "embedFooterIcon" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg.png', - "creditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "creditsRate" BIGINT NOT NULL DEFAULT 1, - "creditsTimeout" BIGINT NOT NULL DEFAULT 5, - "creditsWorkRate" BIGINT NOT NULL DEFAULT 25, - "creditsWorkTimeout" BIGINT NOT NULL DEFAULT 86400, - "creditsMinimumLength" BIGINT NOT NULL DEFAULT 5, - "pointsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "pointsRate" BIGINT NOT NULL DEFAULT 1, - "pointsTimeout" BIGINT NOT NULL DEFAULT 5, - "pointsMinimumLength" BIGINT NOT NULL DEFAULT 5, - "reputationsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "countersEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "apiCpggUrlIv" TEXT, - "apiCpggUrlContent" TEXT, - "apiCpggTokenIv" TEXT, - "apiCpggTokenContent" TEXT, - "auditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "auditsChannelId" TEXT, - "shopRolesEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "shopRolesPricePerHour" BIGINT NOT NULL DEFAULT 5, - "welcomeEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "welcomeJoinChannelId" TEXT, - "welcomeJoinChannelMessage" TEXT, - "welcomeLeaveChannelId" TEXT, - "welcomeLeaveChannelMessage" TEXT, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL -); - -INSERT INTO "new_Guild" ("apiCpggTokenContent", "apiCpggTokenIv", "apiCpggUrlContent", "apiCpggUrlIv", "auditsChannelId", "auditsEnabled", "countersEnabled", "createdAt", "creditsEnabled", "creditsMinimumLength", "creditsRate", "creditsTimeout", "creditsWorkRate", "creditsWorkTimeout", "embedColorError", "embedColorSuccess", "embedColorWait", "embedFooterIcon", "embedFooterText", "id", "pointsEnabled", "pointsMinimumLength", "pointsRate", "pointsTimeout", "reputationsEnabled", "shopRolesEnabled", "shopRolesPricePerHour", "updatedAt", "welcomeEnabled", "welcomeJoinChannelId", "welcomeJoinChannelMessage", "welcomeLeaveChannelId", "welcomeLeaveChannelMessage") -SELECT - "apiCpggTokenContent", - "apiCpggTokenIv", - "apiCpggUrlContent", - "apiCpggUrlIv", - "auditsChannelId", - "auditsEnabled", - "countersEnabled", - "createdAt", - "creditsEnabled", - "creditsMinimumLength", - "creditsRate", - "creditsTimeout", - "creditsWorkRate", - "creditsWorkTimeout", - "embedColorError", - "embedColorSuccess", - "embedColorWait", - "embedFooterIcon", - "embedFooterText", - "id", - "pointsEnabled", - "pointsMinimumLength", - "pointsRate", - "pointsTimeout", - "reputationsEnabled", - "shopRolesEnabled", - "shopRolesPricePerHour", - "updatedAt", - "welcomeEnabled", - "welcomeJoinChannelId", - "welcomeJoinChannelMessage", - "welcomeLeaveChannelId", - "welcomeLeaveChannelMessage" -FROM - "Guild"; - -DROP TABLE "Guild"; - -ALTER TABLE "new_Guild" RENAME TO "Guild"; - -CREATE UNIQUE INDEX "Guild_id_key" ON "Guild" ("id"); - -CREATE TABLE "new_User" ( - "id" TEXT NOT NULL, - "reputationsEarned" BIGINT NOT NULL DEFAULT 0, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL -); - -INSERT INTO "new_User" ("createdAt", "id", "reputationsEarned", "updatedAt") -SELECT - "createdAt", - "id", - "reputationsEarned", - "updatedAt" -FROM - "User"; - -DROP TABLE "User"; - -ALTER TABLE "new_User" RENAME TO "User"; - -CREATE UNIQUE INDEX "User_id_key" ON "User" ("id"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/20221021172345_bigint_to_int/migration.sql b/prisma/migrations/20221021172345_bigint_to_int/migration.sql deleted file mode 100644 index 29f4f08..0000000 --- a/prisma/migrations/20221021172345_bigint_to_int/migration.sql +++ /dev/null @@ -1,244 +0,0 @@ -/* - Warnings: - - - You are about to alter the column `reputationsEarned` on the `User` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Int`. - - You are about to alter the column `count` on the `GuildCounter` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Int`. - - You are about to alter the column `creditsEarned` on the `GuildMember` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Int`. - - You are about to alter the column `pointsEarned` on the `GuildMember` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Int`. - - You are about to alter the column `pricePerHour` on the `GuildShopRoles` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Int`. - - You are about to alter the column `creditsMinimumLength` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Int`. - - You are about to alter the column `creditsRate` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Int`. - - You are about to alter the column `creditsTimeout` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Int`. - - You are about to alter the column `creditsWorkRate` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Int`. - - You are about to alter the column `creditsWorkTimeout` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Int`. - - You are about to alter the column `pointsMinimumLength` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Int`. - - You are about to alter the column `pointsRate` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Int`. - - You are about to alter the column `pointsTimeout` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Int`. - - You are about to alter the column `shopRolesPricePerHour` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Int`. - - You are about to alter the column `cooldown` on the `Cooldown` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Int`. - */ --- RedefineTables - -PRAGMA foreign_keys = OFF; - -CREATE TABLE "new_User" ( - "id" TEXT NOT NULL, - "reputationsEarned" INTEGER NOT NULL DEFAULT 0, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL -); - -INSERT INTO "new_User" ("createdAt", "id", "reputationsEarned", "updatedAt") -SELECT - "createdAt", - "id", - "reputationsEarned", - "updatedAt" -FROM - "User"; - -DROP TABLE "User"; - -ALTER TABLE "new_User" RENAME TO "User"; - -CREATE UNIQUE INDEX "User_id_key" ON "User" ("id"); - -CREATE TABLE "new_GuildCounter" ( - "guildId" TEXT NOT NULL, - "channelId" TEXT NOT NULL, - "triggerWord" TEXT NOT NULL, - "count" INTEGER NOT NULL DEFAULT 0, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "GuildCounter_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_GuildCounter" ("channelId", "count", "createdAt", "guildId", "triggerWord", "updatedAt") -SELECT - "channelId", - "count", - "createdAt", - "guildId", - "triggerWord", - "updatedAt" -FROM - "GuildCounter"; - -DROP TABLE "GuildCounter"; - -ALTER TABLE "new_GuildCounter" RENAME TO "GuildCounter"; - -CREATE UNIQUE INDEX "GuildCounter_guildId_channelId_key" ON "GuildCounter" ("guildId", "channelId"); - -CREATE TABLE "new_GuildMember" ( - "userId" TEXT NOT NULL, - "guildId" TEXT NOT NULL, - "creditsEarned" INTEGER NOT NULL DEFAULT 0, - "pointsEarned" INTEGER NOT NULL DEFAULT 0, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "GuildMember_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "GuildMember_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_GuildMember" ("createdAt", "creditsEarned", "guildId", "pointsEarned", "updatedAt", "userId") -SELECT - "createdAt", - "creditsEarned", - "guildId", - "pointsEarned", - "updatedAt", - "userId" -FROM - "GuildMember"; - -DROP TABLE "GuildMember"; - -ALTER TABLE "new_GuildMember" RENAME TO "GuildMember"; - -CREATE UNIQUE INDEX "GuildMember_userId_guildId_key" ON "GuildMember" ("userId", "guildId"); - -CREATE TABLE "new_GuildShopRoles" ( - "guildId" TEXT NOT NULL, - "roleId" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "pricePerHour" INTEGER NOT NULL DEFAULT 5, - "lastPayed" DATETIME NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "GuildShopRoles_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "GuildShopRoles_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "GuildShopRoles_userId_guildId_fkey" FOREIGN KEY ("userId", - "guildId") REFERENCES "GuildMember" ("userId", - "guildId") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_GuildShopRoles" ("createdAt", "guildId", "lastPayed", "pricePerHour", "roleId", "updatedAt", "userId") -SELECT - "createdAt", - "guildId", - "lastPayed", - "pricePerHour", - "roleId", - "updatedAt", - "userId" -FROM - "GuildShopRoles"; - -DROP TABLE "GuildShopRoles"; - -ALTER TABLE "new_GuildShopRoles" RENAME TO "GuildShopRoles"; - -CREATE UNIQUE INDEX "GuildShopRoles_guildId_userId_roleId_key" ON "GuildShopRoles" ("guildId", "userId", "roleId"); - -CREATE TABLE "new_Guild" ( - "id" TEXT NOT NULL, - "embedColorSuccess" TEXT NOT NULL DEFAULT '#22bb33', - "embedColorWait" TEXT NOT NULL DEFAULT '#f0ad4e', - "embedColorError" TEXT NOT NULL DEFAULT '#bb2124', - "embedFooterText" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg/xyter', - "embedFooterIcon" TEXT NOT NULL DEFAULT 'https://github.com/ZynerOrg.png', - "creditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "creditsRate" INTEGER NOT NULL DEFAULT 1, - "creditsTimeout" INTEGER NOT NULL DEFAULT 5, - "creditsWorkRate" INTEGER NOT NULL DEFAULT 25, - "creditsWorkTimeout" INTEGER NOT NULL DEFAULT 86400, - "creditsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "pointsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "pointsRate" INTEGER NOT NULL DEFAULT 1, - "pointsTimeout" INTEGER NOT NULL DEFAULT 5, - "pointsMinimumLength" INTEGER NOT NULL DEFAULT 5, - "reputationsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "countersEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "apiCpggUrlIv" TEXT, - "apiCpggUrlContent" TEXT, - "apiCpggTokenIv" TEXT, - "apiCpggTokenContent" TEXT, - "auditsEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "auditsChannelId" TEXT, - "shopRolesEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "shopRolesPricePerHour" INTEGER NOT NULL DEFAULT 5, - "welcomeEnabled" BOOLEAN NOT NULL DEFAULT FALSE, - "welcomeJoinChannelId" TEXT, - "welcomeJoinChannelMessage" TEXT, - "welcomeLeaveChannelId" TEXT, - "welcomeLeaveChannelMessage" TEXT, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL -); - -INSERT INTO "new_Guild" ("apiCpggTokenContent", "apiCpggTokenIv", "apiCpggUrlContent", "apiCpggUrlIv", "auditsChannelId", "auditsEnabled", "countersEnabled", "createdAt", "creditsEnabled", "creditsMinimumLength", "creditsRate", "creditsTimeout", "creditsWorkRate", "creditsWorkTimeout", "embedColorError", "embedColorSuccess", "embedColorWait", "embedFooterIcon", "embedFooterText", "id", "pointsEnabled", "pointsMinimumLength", "pointsRate", "pointsTimeout", "reputationsEnabled", "shopRolesEnabled", "shopRolesPricePerHour", "updatedAt", "welcomeEnabled", "welcomeJoinChannelId", "welcomeJoinChannelMessage", "welcomeLeaveChannelId", "welcomeLeaveChannelMessage") -SELECT - "apiCpggTokenContent", - "apiCpggTokenIv", - "apiCpggUrlContent", - "apiCpggUrlIv", - "auditsChannelId", - "auditsEnabled", - "countersEnabled", - "createdAt", - "creditsEnabled", - "creditsMinimumLength", - "creditsRate", - "creditsTimeout", - "creditsWorkRate", - "creditsWorkTimeout", - "embedColorError", - "embedColorSuccess", - "embedColorWait", - "embedFooterIcon", - "embedFooterText", - "id", - "pointsEnabled", - "pointsMinimumLength", - "pointsRate", - "pointsTimeout", - "reputationsEnabled", - "shopRolesEnabled", - "shopRolesPricePerHour", - "updatedAt", - "welcomeEnabled", - "welcomeJoinChannelId", - "welcomeJoinChannelMessage", - "welcomeLeaveChannelId", - "welcomeLeaveChannelMessage" -FROM - "Guild"; - -DROP TABLE "Guild"; - -ALTER TABLE "new_Guild" RENAME TO "Guild"; - -CREATE UNIQUE INDEX "Guild_id_key" ON "Guild" ("id"); - -CREATE TABLE "new_Cooldown" ( - "guildId" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "cooldown" INTEGER NOT NULL, - "timeoutId" TEXT NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" DATETIME NOT NULL, - CONSTRAINT "Cooldown_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, - CONSTRAINT "Cooldown_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE -); - -INSERT INTO "new_Cooldown" ("cooldown", "createdAt", "guildId", "timeoutId", "updatedAt", "userId") -SELECT - "cooldown", - "createdAt", - "guildId", - "timeoutId", - "updatedAt", - "userId" -FROM - "Cooldown"; - -DROP TABLE "Cooldown"; - -ALTER TABLE "new_Cooldown" RENAME TO "Cooldown"; - -CREATE UNIQUE INDEX "Cooldown_guildId_userId_timeoutId_key" ON "Cooldown" ("guildId", "userId", "timeoutId"); - -PRAGMA foreign_key_check; - -PRAGMA foreign_keys = ON; diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml deleted file mode 100644 index 6fcf33d..0000000 --- a/prisma/migrations/migration_lock.toml +++ /dev/null @@ -1,3 +0,0 @@ -# Please do not edit this file manually -# It should be added in your version-control system (i.e. Git) -provider = "sqlite" diff --git a/prisma/schema.prisma b/prisma/schema.prisma index f7923d4..8157a35 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -7,7 +7,7 @@ generator client { } datasource db { - provider = "sqlite" + provider = "mysql" url = env("DATABASE_URL") }