From 84b181209578ca52ca4459b0d1a7321ef787fc3c Mon Sep 17 00:00:00 2001 From: charles-gauthereau Date: Sun, 17 Nov 2024 11:45:22 +0100 Subject: [PATCH] Working on settings Page. Adding init function on next.js startup. --- app/(customer)/dashboard/layout.tsx | 1 - .../20241110140612_2024_11_10/migration.sql | 2 ++ .../20241111152326_2024_11_11/migration.sql | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 prisma/migrations/20241110140612_2024_11_10/migration.sql create mode 100644 prisma/migrations/20241111152326_2024_11_11/migration.sql diff --git a/app/(customer)/dashboard/layout.tsx b/app/(customer)/dashboard/layout.tsx index 3a87b375..fc486b1e 100644 --- a/app/(customer)/dashboard/layout.tsx +++ b/app/(customer)/dashboard/layout.tsx @@ -18,7 +18,6 @@ export default async function Layout({children}: { children: React.ReactNode }) email: user?.email } }) - if(userInfo){ redirect('/login') } diff --git a/prisma/migrations/20241110140612_2024_11_10/migration.sql b/prisma/migrations/20241110140612_2024_11_10/migration.sql new file mode 100755 index 00000000..50f2c768 --- /dev/null +++ b/prisma/migrations/20241110140612_2024_11_10/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "users" ADD COLUMN "authMethod" TEXT; diff --git a/prisma/migrations/20241111152326_2024_11_11/migration.sql b/prisma/migrations/20241111152326_2024_11_11/migration.sql new file mode 100644 index 00000000..8a710941 --- /dev/null +++ b/prisma/migrations/20241111152326_2024_11_11/migration.sql @@ -0,0 +1,15 @@ +/* + Warnings: + + - A unique constraint covering the columns `[slug]` on the table `Agent` will be added. If there are existing duplicate values, this will fail. + - Added the required column `slug` to the `Agent` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE "Agent" ADD COLUMN "slug" TEXT NOT NULL; + +-- CreateIndex +CREATE UNIQUE INDEX "Agent_slug_key" ON "Agent"("slug"); + +-- AddForeignKey +ALTER TABLE "Database" ADD CONSTRAINT "Database_agent_id_fkey" FOREIGN KEY ("agent_id") REFERENCES "Agent"("id") ON DELETE CASCADE ON UPDATE CASCADE;