1
0

Basic transaction system

This commit is contained in:
Ahmed Al-Taiar
2023-11-14 18:54:44 -05:00
parent f6f01594ec
commit 8060e1e452
60 changed files with 2037 additions and 507 deletions

View File

@ -0,0 +1,18 @@
/*
Warnings:
- Added the required column `type` to the `Transaction` table without a default value. This is not possible if the table is not empty.
*/
-- CreateEnum
CREATE TYPE "TransactionType" AS ENUM ('in', 'out');
-- AlterTable
ALTER TABLE "Part" ADD COLUMN "transactionId" INTEGER;
-- AlterTable
ALTER TABLE "Transaction" ADD COLUMN "quantities" INTEGER[],
ADD COLUMN "type" "TransactionType" NOT NULL;
-- AddForeignKey
ALTER TABLE "Part" ADD CONSTRAINT "Part_transactionId_fkey" FOREIGN KEY ("transactionId") REFERENCES "Transaction"("id") ON DELETE SET NULL ON UPDATE CASCADE;