-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into develop
- Loading branch information
Showing
5 changed files
with
155 additions
and
15 deletions.
There are no files selected for viewing
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
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
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
132 changes: 132 additions & 0 deletions
132
apps/nextjs/prisma/migrations/20240408205952_init/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,132 @@ | ||
-- CreateTable | ||
CREATE TABLE "accounts" ( | ||
"id" TEXT NOT NULL, | ||
"user_id" TEXT NOT NULL, | ||
"type" TEXT NOT NULL, | ||
"provider" TEXT NOT NULL, | ||
"provider_account_id" TEXT NOT NULL, | ||
"refresh_token" TEXT, | ||
"access_token" TEXT, | ||
"expires_at" INTEGER, | ||
"token_type" TEXT, | ||
"scope" TEXT, | ||
"id_token" TEXT, | ||
"session_state" TEXT, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updated_at" TIMESTAMP(3) NOT NULL, | ||
|
||
CONSTRAINT "accounts_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "sessions" ( | ||
"id" TEXT NOT NULL, | ||
"session_token" TEXT NOT NULL, | ||
"user_id" TEXT NOT NULL, | ||
"expires" TIMESTAMP(3) NOT NULL, | ||
|
||
CONSTRAINT "sessions_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "users" ( | ||
"id" TEXT NOT NULL, | ||
"fdai_user_id" INTEGER, | ||
"fdai_access_token" TEXT, | ||
"fdai_refresh_token" TEXT, | ||
"fdai_expires_in" INTEGER, | ||
"fdai_scope" TEXT, | ||
"fdai_access_token_expires_at" TIMESTAMP(3), | ||
"address" TEXT, | ||
"banned" BOOLEAN, | ||
"birthday" TIMESTAMP(3), | ||
"city" TEXT, | ||
"country_code" TEXT, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"deleted_at" TIMESTAMP(3), | ||
"email" TEXT, | ||
"email_verified" TIMESTAMP(3), | ||
"email_validated" BOOLEAN NOT NULL DEFAULT false, | ||
"first_name" TEXT, | ||
"gdpr_consent" BOOLEAN NOT NULL DEFAULT false, | ||
"gender" TEXT, | ||
"image" TEXT, | ||
"ip_address" VARCHAR(45), | ||
"language" TEXT, | ||
"last_name" TEXT, | ||
"last_sign_in_at" BIGINT, | ||
"name" TEXT, | ||
"newsletter_subscribed" BOOLEAN NOT NULL DEFAULT false, | ||
"phone_number" TEXT, | ||
"postal_code" TEXT, | ||
"referrer_user_id" TEXT, | ||
"state_province" TEXT, | ||
"updated_at" TIMESTAMP(3) NOT NULL, | ||
"username" TEXT NOT NULL, | ||
"web3_wallet" TEXT, | ||
"unsafe_metadata" JSONB, | ||
"public_metadata" JSONB, | ||
"private_metadata" JSONB, | ||
|
||
CONSTRAINT "users_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "verification_tokens" ( | ||
"identifier" TEXT NOT NULL, | ||
"token" TEXT NOT NULL, | ||
"expires" TIMESTAMP(3) NOT NULL | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "activities" ( | ||
"id" TEXT NOT NULL, | ||
"user_id" TEXT NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"description" TEXT, | ||
"color_code" TEXT NOT NULL, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updated_at" TIMESTAMP(3) NOT NULL, | ||
|
||
CONSTRAINT "activities_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "activity_log" ( | ||
"id" TEXT NOT NULL, | ||
"activity_id" TEXT NOT NULL, | ||
"date" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"count" INTEGER NOT NULL DEFAULT 1, | ||
|
||
CONSTRAINT "activity_log_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "accounts_provider_provider_account_id_key" ON "accounts"("provider", "provider_account_id"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "sessions_session_token_key" ON "sessions"("session_token"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "users_email_key" ON "users"("email"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "users_username_key" ON "users"("username"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "verification_tokens_token_key" ON "verification_tokens"("token"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "verification_tokens_identifier_token_key" ON "verification_tokens"("identifier", "token"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "accounts" ADD CONSTRAINT "accounts_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "sessions" ADD CONSTRAINT "sessions_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "activities" ADD CONSTRAINT "activities_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "activity_log" ADD CONSTRAINT "activity_log_activity_id_fkey" FOREIGN KEY ("activity_id") REFERENCES "activities"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
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" |