diff --git a/prisma/migrations/20230718174123_create_created_at_and_updated_at/migration.sql b/prisma/migrations/20230718174123_create_created_at_and_updated_at/migration.sql deleted file mode 100644 index 860328d..0000000 --- a/prisma/migrations/20230718174123_create_created_at_and_updated_at/migration.sql +++ /dev/null @@ -1,14 +0,0 @@ -/* - Warnings: - - - Added the required column `updatedAt` to the `Room` 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. - -*/ --- AlterTable -ALTER TABLE "Room" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, -ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL; - --- AlterTable -ALTER TABLE "User" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, -ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL; diff --git a/prisma/migrations/20230719092330_users_api/migration.sql b/prisma/migrations/20230719092330_users_api/migration.sql deleted file mode 100644 index 40653bd..0000000 --- a/prisma/migrations/20230719092330_users_api/migration.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `username` on the `User` table. All the data in the column will be lost. - - The `enableTimes` column on the `User` table would be dropped and recreated. This will lead to data loss if there is data in the column. - - A unique constraint covering the columns `[userName]` on the table `User` will be added. If there are existing duplicate values, this will fail. - - Added the required column `userName` to the `User` table without a default value. This is not possible if the table is not empty. - -*/ --- DropIndex -DROP INDEX "User_username_key"; - --- AlterTable -ALTER TABLE "User" DROP COLUMN "username", -ADD COLUMN "userName" TEXT NOT NULL, -DROP COLUMN "enableTimes", -ADD COLUMN "enableTimes" TEXT[]; - --- CreateIndex -CREATE UNIQUE INDEX "User_userName_key" ON "User"("userName"); diff --git a/prisma/migrations/20230625180516_init/migration.sql b/prisma/migrations/20230803135528_initial_migration/migration.sql similarity index 73% rename from prisma/migrations/20230625180516_init/migration.sql rename to prisma/migrations/20230803135528_initial_migration/migration.sql index f33acd6..3bae10f 100644 --- a/prisma/migrations/20230625180516_init/migration.sql +++ b/prisma/migrations/20230803135528_initial_migration/migration.sql @@ -5,6 +5,8 @@ CREATE TABLE "Room" ( "dateOnly" BOOLEAN NOT NULL, "startTime" TEXT, "endTime" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, CONSTRAINT "Room_pkey" PRIMARY KEY ("code") ); @@ -14,8 +16,10 @@ CREATE TABLE "User" ( "id" TEXT NOT NULL, "username" TEXT NOT NULL, "password" TEXT NOT NULL, - "enableTimes" TEXT NOT NULL, + "enableTimes" TEXT[], "roomId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, CONSTRAINT "User_pkey" PRIMARY KEY ("id") );