From 9062e040ffede070331801d95352b07a9df20e91 Mon Sep 17 00:00:00 2001 From: MTG2000 Date: Wed, 7 Sep 2022 11:35:13 +0300 Subject: [PATCH] update: tournament date field type --- .../migration.sql | 12 ++++++++++++ prisma/schema.prisma | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 prisma/migrations/20220907083457_update_tournament_event_date_field/migration.sql diff --git a/prisma/migrations/20220907083457_update_tournament_event_date_field/migration.sql b/prisma/migrations/20220907083457_update_tournament_event_date_field/migration.sql new file mode 100644 index 0000000..777faca --- /dev/null +++ b/prisma/migrations/20220907083457_update_tournament_event_date_field/migration.sql @@ -0,0 +1,12 @@ +/* + Warnings: + + - You are about to drop the column `date` on the `TournamentEvent` table. All the data in the column will be lost. + - Added the required column `ends_at` to the `TournamentEvent` table without a default value. This is not possible if the table is not empty. + - Added the required column `starts_at` to the `TournamentEvent` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE "TournamentEvent" DROP COLUMN "date", +ADD COLUMN "ends_at" DATE NOT NULL, +ADD COLUMN "starts_at" DATE NOT NULL; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 87b4d2a..0eeec07 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -333,7 +333,8 @@ model TournamentEvent { title String image String description String - date DateTime @db.Date + starts_at DateTime @db.Date + ends_at DateTime @db.Date location String website String type Int