aboutsummaryrefslogtreecommitdiffstats
path: root/prisma/migrations/20240128193431_update_documents
diff options
context:
space:
mode:
authorSebastien Castiel <sebastien@castiel.me>2024-01-28 18:51:29 -0500
committerGitHub <noreply@github.com>2024-01-28 18:51:29 -0500
commitd43e731fe191d7e35d96847fe095c94555dd8ca6 (patch)
treeb8bc3f99770a47ec0343f642ca04e727f7abd716 /prisma/migrations/20240128193431_update_documents
parent11d2e298e8cc5cac07aa2c60e194bf4460cefb21 (diff)
Attach documents to expenses (#64)
* Upload documents to receipts * Improve documents * Make the feature opt-in * Fix file name issue
Diffstat (limited to 'prisma/migrations/20240128193431_update_documents')
-rw-r--r--prisma/migrations/20240128193431_update_documents/migration.sql20
1 files changed, 20 insertions, 0 deletions
diff --git a/prisma/migrations/20240128193431_update_documents/migration.sql b/prisma/migrations/20240128193431_update_documents/migration.sql
new file mode 100644
index 0000000..9626e36
--- /dev/null
+++ b/prisma/migrations/20240128193431_update_documents/migration.sql
@@ -0,0 +1,20 @@
+/*
+ Warnings:
+
+ - You are about to drop the column `documentUrls` on the `Expense` table. All the data in the column will be lost.
+
+*/
+-- AlterTable
+ALTER TABLE "Expense" DROP COLUMN "documentUrls";
+
+-- CreateTable
+CREATE TABLE "ExpenseDocument" (
+ "id" TEXT NOT NULL,
+ "url" TEXT NOT NULL,
+ "expenseId" TEXT,
+
+ CONSTRAINT "ExpenseDocument_pkey" PRIMARY KEY ("id")
+);
+
+-- AddForeignKey
+ALTER TABLE "ExpenseDocument" ADD CONSTRAINT "ExpenseDocument_expenseId_fkey" FOREIGN KEY ("expenseId") REFERENCES "Expense"("id") ON DELETE SET NULL ON UPDATE CASCADE;