-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
-- CreateEnum | ||
CREATE TYPE "TransactionType" AS ENUM ('DEPOSIT', 'EXPENSE', 'INVESTMENT'); | ||
|
||
-- CreateEnum | ||
CREATE TYPE "TransactionCategory" AS ENUM ('HOUSING', 'TRANSPORTATION', 'FOOD', 'ENTERTAINMENT', 'HEALTH', 'UTILITY', 'SALARY', 'EDUCATION', 'OTHER'); | ||
|
||
-- CreateEnum | ||
CREATE TYPE "TransactionPaymentMethod" AS ENUM ('CREDIT_CARD', 'DEBIT_CARD', 'BANK_TRANSFER', 'BANK_SLIP', 'CASH', 'PIX', 'OTHER'); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Transactions" ( | ||
"id" TEXT NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"type" "TransactionType" NOT NULL, | ||
"amount" DECIMAL(10,2) NOT NULL, | ||
"category" "TransactionCategory" NOT NULL, | ||
"paymentMethod" "TransactionPaymentMethod" NOT NULL, | ||
"date" TIMESTAMP(3) NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
|
||
CONSTRAINT "Transactions_pkey" PRIMARY KEY ("id") | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// This is your Prisma schema file, | ||
// learn more about it in the docs: https://pris.ly/d/prisma-schema | ||
|
||
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions? | ||
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
enum TransactionType { | ||
DEPOSIT | ||
EXPENSE | ||
INVESTMENT | ||
} | ||
|
||
enum TransactionCategory { | ||
HOUSING | ||
TRANSPORTATION | ||
FOOD | ||
ENTERTAINMENT | ||
HEALTH | ||
UTILITY | ||
SALARY | ||
EDUCATION | ||
OTHER | ||
} | ||
|
||
enum TransactionPaymentMethod { | ||
CREDIT_CARD | ||
DEBIT_CARD | ||
BANK_TRANSFER | ||
BANK_SLIP | ||
CASH | ||
PIX | ||
OTHER | ||
} | ||
|
||
model Transactions { | ||
id String @id @default(uuid()) | ||
name String | ||
type TransactionType | ||
amount Decimal @db.Decimal(10, 2) | ||
category TransactionCategory | ||
paymentMethod TransactionPaymentMethod | ||
date DateTime | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
} |