Skip to content

Commit

Permalink
Merge pull request #55 from RoutinelyOrganization/develop
Browse files Browse the repository at this point in the history
Sync
  • Loading branch information
viniciuscosmome authored Nov 10, 2023
2 parents ef7736b + 6410cd7 commit 6ef0ad9
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 208 deletions.
32 changes: 0 additions & 32 deletions prisma/migrations/20230618214820_setup/migration.sql

This file was deleted.

27 changes: 0 additions & 27 deletions prisma/migrations/20230620193039_sessions_model/migration.sql

This file was deleted.

16 changes: 0 additions & 16 deletions prisma/migrations/20230626145634_/migration.sql

This file was deleted.

8 changes: 0 additions & 8 deletions prisma/migrations/20230629223840_/migration.sql

This file was deleted.

8 changes: 0 additions & 8 deletions prisma/migrations/20230629233735_/migration.sql

This file was deleted.

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions prisma/migrations/20230814205213_/migration.sql

This file was deleted.

32 changes: 0 additions & 32 deletions prisma/migrations/20230814220259_/migration.sql

This file was deleted.

12 changes: 0 additions & 12 deletions prisma/migrations/20230816192752_/migration.sql

This file was deleted.

27 changes: 0 additions & 27 deletions prisma/migrations/20230818210820_/migration.sql

This file was deleted.

24 changes: 0 additions & 24 deletions prisma/migrations/20231004195435_/migration.sql

This file was deleted.

128 changes: 128 additions & 0 deletions prisma/migrations/20231110061420_initial_setup/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
-- CreateEnum
CREATE TYPE "GoalPeriodicity" AS ENUM ('daily', 'weekly', 'biweekly', 'monthly', 'bimonthly');

-- CreateEnum
CREATE TYPE "GoalType" AS ENUM ('personal', 'profissional');

-- CreateEnum
CREATE TYPE "TaskPriorities" AS ENUM ('low', 'medium', 'high', 'urgent');

-- CreateEnum
CREATE TYPE "TaskTags" AS ENUM ('personal', 'study', 'finance', 'career', 'health');

-- CreateTable
CREATE TABLE "accounts" (
"id" TEXT NOT NULL,
"email" TEXT NOT NULL,
"password" TEXT NOT NULL,
"permissions" TEXT[],
"verified_at" TIMESTAMP(3),
"accepted_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,

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

-- CreateTable
CREATE TABLE "ResetPasswordToken" (
"id" SERIAL NOT NULL,
"token" TEXT NOT NULL,
"account_id" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

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

-- CreateTable
CREATE TABLE "profiles" (
"id" SERIAL NOT NULL,
"name" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
"account_id" TEXT NOT NULL,

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

-- CreateTable
CREATE TABLE "sessions" (
"id" SERIAL NOT NULL,
"session_token" TEXT NOT NULL,
"refresh_token" TEXT NOT NULL,
"account_id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"permissions" TEXT[],
"remember" BOOLEAN NOT NULL DEFAULT false,
"session_expires_in" TIMESTAMP(3) NOT NULL,
"refresh_expires_in" TIMESTAMP(3) NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,

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

-- CreateTable
CREATE TABLE "tasks" (
"id" SERIAL NOT NULL,
"name" TEXT NOT NULL,
"hour" TIME NOT NULL,
"date" DATE NOT NULL,
"description" TEXT NOT NULL,
"priority" "TaskPriorities" NOT NULL,
"tag" "TaskTags" NOT NULL,
"account_id" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,

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

-- CreateTable
CREATE TABLE "goals" (
"id" SERIAL NOT NULL,
"description" TEXT NOT NULL,
"goal" TEXT NOT NULL,
"start_date" DATE NOT NULL,
"end_date" DATE NOT NULL,
"periodicity" "GoalPeriodicity" NOT NULL,
"type" "GoalType" NOT NULL,
"account_id" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,

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

-- CreateIndex
CREATE UNIQUE INDEX "accounts_email_key" ON "accounts"("email");

-- CreateIndex
CREATE UNIQUE INDEX "ResetPasswordToken_token_key" ON "ResetPasswordToken"("token");

-- CreateIndex
CREATE UNIQUE INDEX "ResetPasswordToken_account_id_key" ON "ResetPasswordToken"("account_id");

-- CreateIndex
CREATE UNIQUE INDEX "profiles_account_id_key" ON "profiles"("account_id");

-- CreateIndex
CREATE UNIQUE INDEX "sessions_session_token_key" ON "sessions"("session_token");

-- CreateIndex
CREATE UNIQUE INDEX "sessions_refresh_token_key" ON "sessions"("refresh_token");

-- AddForeignKey
ALTER TABLE "ResetPasswordToken" ADD CONSTRAINT "ResetPasswordToken_account_id_fkey" FOREIGN KEY ("account_id") REFERENCES "accounts"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "profiles" ADD CONSTRAINT "profiles_account_id_fkey" FOREIGN KEY ("account_id") REFERENCES "accounts"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "sessions" ADD CONSTRAINT "sessions_account_id_fkey" FOREIGN KEY ("account_id") REFERENCES "accounts"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "tasks" ADD CONSTRAINT "tasks_account_id_fkey" FOREIGN KEY ("account_id") REFERENCES "accounts"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "goals" ADD CONSTRAINT "goals_account_id_fkey" FOREIGN KEY ("account_id") REFERENCES "accounts"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

0 comments on commit 6ef0ad9

Please sign in to comment.