This commit is contained in:
Andras Bacsai
2022-12-12 08:44:23 +01:00
parent f55b861849
commit c445fc0f8a
44 changed files with 3130 additions and 53 deletions

View File

@@ -0,0 +1,21 @@
-- CreateTable
CREATE TABLE "Category" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT NOT NULL,
"budget" INTEGER NOT NULL,
"customIcon" TEXT,
"period" TEXT NOT NULL DEFAULT 'month',
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL
);
-- CreateTable
CREATE TABLE "Transaction" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"amount" INTEGER NOT NULL,
"description" TEXT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL,
"categoryId" INTEGER NOT NULL,
CONSTRAINT "Transaction_categoryId_fkey" FOREIGN KEY ("categoryId") REFERENCES "Category" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);

View File

@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "sqlite"