-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: 🚧 migrating from planetscale to neon
- Loading branch information
1 parent
f20af89
commit 8981ce9
Showing
3 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
prisma/migrations/20240408163644_neon_migration/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters