Skip to content

Commit

Permalink
chore: 🚧 migrating from planetscale to neon
Browse files Browse the repository at this point in the history
  • Loading branch information
subhamBharadwaz committed Apr 8, 2024
1 parent f20af89 commit 8981ce9
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 2 deletions.
60 changes: 60 additions & 0 deletions prisma/migrations/20240408163644_neon_migration/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
-- CreateEnum
CREATE TYPE "ReminderType" AS ENUM ('DAILY', 'WEEKLY');

-- CreateTable
CREATE TABLE "users" (
"id" TEXT NOT NULL,
"name" TEXT,
"email" TEXT,
"clerkId" TEXT NOT NULL,
"image" TEXT,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
"stripe_customer_id" TEXT,
"stripe_subscription_id" TEXT,
"stripe_price_id" TEXT,
"stripe_current_period_end" TIMESTAMP(3),

CONSTRAINT "users_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "journal_entries" (
"id" TEXT NOT NULL,
"title" TEXT NOT NULL,
"content" JSONB,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
"userId" TEXT NOT NULL,

CONSTRAINT "journal_entries_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "reminders" (
"id" TEXT NOT NULL,
"frequency" "ReminderType" DEFAULT 'DAILY',
"time" TIME(0) DEFAULT '09:00:00',
"active" BOOLEAN DEFAULT false,
"userId" TEXT NOT NULL,

CONSTRAINT "reminders_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "users_email_key" ON "users"("email");

-- CreateIndex
CREATE UNIQUE INDEX "users_clerkId_key" ON "users"("clerkId");

-- CreateIndex
CREATE UNIQUE INDEX "users_stripe_customer_id_key" ON "users"("stripe_customer_id");

-- CreateIndex
CREATE UNIQUE INDEX "users_stripe_subscription_id_key" ON "users"("stripe_subscription_id");

-- CreateIndex
CREATE UNIQUE INDEX "journal_entries_userId_id_key" ON "journal_entries"("userId", "id");

-- CreateIndex
CREATE UNIQUE INDEX "reminders_userId_key" ON "reminders"("userId");
3 changes: 3 additions & 0 deletions prisma/migrations/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "postgresql"
5 changes: 3 additions & 2 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
previewFeatures = ["fullTextSearch", "fullTextIndex", "driverAdapters"]
}

datasource db {
provider = "mysql"
provider = "postgresql"
url = env("DATABASE_URL")
relationMode = "prisma"
}
Expand Down

0 comments on commit 8981ce9

Please sign in to comment.