From 6e802f8dcd32ccdb44271ec9f4e277f8a0cf5ce5 Mon Sep 17 00:00:00 2001 From: smyalygames Date: Sat, 11 Feb 2023 18:17:23 +0000 Subject: [PATCH] refactor(db): fix typos in column names --- .../20230211163443_restrict/migration.sql | 5 +++++ .../20230211163734_fix_typo/migration.sql | 15 +++++++++++++++ prisma/schema.prisma | 4 ++-- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 prisma/migrations/20230211163443_restrict/migration.sql create mode 100644 prisma/migrations/20230211163734_fix_typo/migration.sql diff --git a/prisma/migrations/20230211163443_restrict/migration.sql b/prisma/migrations/20230211163443_restrict/migration.sql new file mode 100644 index 0000000..a9f047e --- /dev/null +++ b/prisma/migrations/20230211163443_restrict/migration.sql @@ -0,0 +1,5 @@ +-- AlterTable +ALTER TABLE "Restrict" ADD COLUMN "endModId" TEXT; + +-- AddForeignKey +ALTER TABLE "Restrict" ADD CONSTRAINT "Restrict_endModId_fkey" FOREIGN KEY ("endModId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/prisma/migrations/20230211163734_fix_typo/migration.sql b/prisma/migrations/20230211163734_fix_typo/migration.sql new file mode 100644 index 0000000..930458b --- /dev/null +++ b/prisma/migrations/20230211163734_fix_typo/migration.sql @@ -0,0 +1,15 @@ +/* + Warnings: + + - You are about to drop the column `endedTime` on the `Restrict` table. All the data in the column will be lost. + - You are about to drop the column `endedTime` on the `TempBan` table. All the data in the column will be lost. + - Added the required column `endTime` to the `TempBan` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE "Restrict" DROP COLUMN "endedTime", +ADD COLUMN "endTime" TIMESTAMP(3); + +-- AlterTable +ALTER TABLE "TempBan" DROP COLUMN "endedTime", +ADD COLUMN "endTime" TIMESTAMP(3) NOT NULL; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index db3f3ff..9566290 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -100,7 +100,7 @@ model Restrict { startTime DateTime @default(now()) endMod User? @relation("endRestMod", fields: [endModId], references: [id]) endModId String? - endedTime DateTime? + endTime DateTime? reason String } @@ -125,7 +125,7 @@ model TempBan { mod User @relation("tbanMod", fields: [modId], references: [id]) modId String startTime DateTime @default(now()) - endedTime DateTime + endTime DateTime active Boolean @default(true) reason String }