mirror of
https://github.com/marcogll/TaxHacker_s23.git
synced 2026-01-14 04:55:27 +00:00
(squash) init
feat: filters, settings, backups fix: ts compile errors feat: new dashboard, webp previews and settings feat: use webp for pdfs feat: use webp fix: analyze resets old data fix: switch to corsproxy fix: switch to free cors fix: max upload limit fix: currency conversion feat: transaction export fix: currency conversion feat: refactor settings actions feat: new loader feat: README + LICENSE doc: update readme doc: update readme doc: update readme doc: update screenshots ci: bump prisma
This commit is contained in:
84
prisma/migrations/20250312231916_init/migration.sql
Normal file
84
prisma/migrations/20250312231916_init/migration.sql
Normal file
@@ -0,0 +1,84 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "settings" (
|
||||
"code" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"description" TEXT,
|
||||
"value" TEXT
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "categories" (
|
||||
"code" TEXT NOT NULL PRIMARY KEY,
|
||||
"name" TEXT NOT NULL,
|
||||
"color" TEXT NOT NULL DEFAULT '#000000',
|
||||
"llm_prompt" TEXT,
|
||||
"created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "projects" (
|
||||
"code" TEXT NOT NULL PRIMARY KEY,
|
||||
"name" TEXT NOT NULL,
|
||||
"color" TEXT NOT NULL DEFAULT '#000000',
|
||||
"llm_prompt" TEXT,
|
||||
"created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "fields" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"code" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"type" TEXT NOT NULL,
|
||||
"llm_prompt" TEXT,
|
||||
"options" JSONB,
|
||||
"is_required" BOOLEAN NOT NULL DEFAULT false,
|
||||
"is_extra" BOOLEAN NOT NULL DEFAULT true
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "files" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"filename" TEXT NOT NULL,
|
||||
"path" TEXT NOT NULL,
|
||||
"mimetype" TEXT NOT NULL,
|
||||
"metadata" JSONB,
|
||||
"is_reviewed" BOOLEAN NOT NULL DEFAULT false,
|
||||
"created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "transactions" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"name" TEXT,
|
||||
"description" TEXT,
|
||||
"merchant" TEXT,
|
||||
"total" INTEGER,
|
||||
"currency_code" TEXT,
|
||||
"converted_total" INTEGER,
|
||||
"converted_currency_code" TEXT,
|
||||
"type" TEXT DEFAULT 'expense',
|
||||
"note" TEXT,
|
||||
"files" JSONB NOT NULL DEFAULT [],
|
||||
"extra" JSONB,
|
||||
"category_id" TEXT,
|
||||
"project_id" TEXT,
|
||||
"issued_at" DATETIME,
|
||||
"created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" DATETIME NOT NULL,
|
||||
"text" TEXT,
|
||||
CONSTRAINT "transactions_category_id_fkey" FOREIGN KEY ("category_id") REFERENCES "categories" ("code") ON DELETE SET NULL ON UPDATE CASCADE,
|
||||
CONSTRAINT "transactions_project_id_fkey" FOREIGN KEY ("project_id") REFERENCES "projects" ("code") ON DELETE SET NULL ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "currencies" (
|
||||
"code" TEXT NOT NULL PRIMARY KEY,
|
||||
"name" TEXT NOT NULL
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "settings_code_key" ON "settings"("code");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "fields_code_key" ON "fields"("code");
|
||||
Reference in New Issue
Block a user