mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-16 20:49:28 +00:00
22 lines
741 B
SQL
22 lines
741 B
SQL
-- 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
|
|
);
|