aboutsummaryrefslogtreecommitdiffstats
path: root/prisma/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'prisma/migrations')
-rw-r--r--prisma/migrations/20240126214121_add_document_urls/migration.sql2
-rw-r--r--prisma/migrations/20240128192510_update_document_urls/migration.sql9
-rw-r--r--prisma/migrations/20240128193431_update_documents/migration.sql20
-rw-r--r--prisma/migrations/20240128202400_add_doc_info/migration.sql10
4 files changed, 41 insertions, 0 deletions
diff --git a/prisma/migrations/20240126214121_add_document_urls/migration.sql b/prisma/migrations/20240126214121_add_document_urls/migration.sql
new file mode 100644
index 0000000..1691143
--- /dev/null
+++ b/prisma/migrations/20240126214121_add_document_urls/migration.sql
@@ -0,0 +1,2 @@
+-- AlterTable
+ALTER TABLE "Expense" ADD COLUMN "documentUrls" TEXT[] DEFAULT ARRAY[]::TEXT[];
diff --git a/prisma/migrations/20240128192510_update_document_urls/migration.sql b/prisma/migrations/20240128192510_update_document_urls/migration.sql
new file mode 100644
index 0000000..1f12259
--- /dev/null
+++ b/prisma/migrations/20240128192510_update_document_urls/migration.sql
@@ -0,0 +1,9 @@
+/*
+ Warnings:
+
+ - The `documentUrls` column on the `Expense` table would be dropped and recreated. This will lead to data loss if there is data in the column.
+
+*/
+-- AlterTable
+ALTER TABLE "Expense" DROP COLUMN "documentUrls",
+ADD COLUMN "documentUrls" JSONB[] DEFAULT ARRAY[]::JSONB[];
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;
diff --git a/prisma/migrations/20240128202400_add_doc_info/migration.sql b/prisma/migrations/20240128202400_add_doc_info/migration.sql
new file mode 100644
index 0000000..cb3addb
--- /dev/null
+++ b/prisma/migrations/20240128202400_add_doc_info/migration.sql
@@ -0,0 +1,10 @@
+/*
+ Warnings:
+
+ - Added the required column `height` to the `ExpenseDocument` table without a default value. This is not possible if the table is not empty.
+ - Added the required column `width` to the `ExpenseDocument` table without a default value. This is not possible if the table is not empty.
+
+*/
+-- AlterTable
+ALTER TABLE "ExpenseDocument" ADD COLUMN "height" INTEGER NOT NULL,
+ADD COLUMN "width" INTEGER NOT NULL;