Implement expense tracking foundation for v1
This commit is contained in:
28
prisma/migrations/20260323161757_init/migration.sql
Normal file
28
prisma/migrations/20260323161757_init/migration.sql
Normal file
@@ -0,0 +1,28 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "Expense" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"date" TEXT NOT NULL,
|
||||
"title" TEXT NOT NULL,
|
||||
"amountCents" INTEGER NOT NULL,
|
||||
"category" TEXT NOT NULL,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Paycheck" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"payDate" TEXT NOT NULL,
|
||||
"amountCents" INTEGER NOT NULL,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "MonthlyInsight" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"month" TEXT NOT NULL,
|
||||
"year" INTEGER NOT NULL,
|
||||
"generatedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"summary" TEXT NOT NULL,
|
||||
"recommendations" TEXT NOT NULL,
|
||||
"inputSnapshot" TEXT NOT NULL
|
||||
);
|
||||
3
prisma/migrations/migration_lock.toml
Normal file
3
prisma/migrations/migration_lock.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
# Please do not edit this file manually
|
||||
# It should be added in your version-control system (e.g., Git)
|
||||
provider = "sqlite"
|
||||
BIN
prisma/prisma/dev.db
Normal file
BIN
prisma/prisma/dev.db
Normal file
Binary file not shown.
45
prisma/schema.prisma
Normal file
45
prisma/schema.prisma
Normal file
@@ -0,0 +1,45 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "sqlite"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
enum Category {
|
||||
RENT
|
||||
FOOD
|
||||
TRANSPORT
|
||||
BILLS
|
||||
SHOPPING
|
||||
HEALTH
|
||||
ENTERTAINMENT
|
||||
MISC
|
||||
}
|
||||
|
||||
model Expense {
|
||||
id String @id @default(cuid())
|
||||
date String
|
||||
title String
|
||||
amountCents Int
|
||||
category Category
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model Paycheck {
|
||||
id String @id @default(cuid())
|
||||
payDate String
|
||||
amountCents Int
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model MonthlyInsight {
|
||||
id String @id @default(cuid())
|
||||
month String
|
||||
year Int
|
||||
generatedAt DateTime @default(now())
|
||||
summary String
|
||||
recommendations String
|
||||
inputSnapshot String
|
||||
}
|
||||
Reference in New Issue
Block a user