diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-15 11:18:35 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-15 11:18:35 +0700 |
| commit | 2af2659018d08cd8685a6e727994ab76f0735189 (patch) | |
| tree | 5d1327d8269c9e2f625ec809ac31beb4fb4b08e4 /prisma | |
| parent | d131b3cc79148b9f72a9bfe2fab3a0c6b3dd092d (diff) | |
<Miqdad> Locatorlocator
Diffstat (limited to 'prisma')
| -rw-r--r-- | prisma/migrations/20260215035919_test/migration.sql | 5 | ||||
| -rw-r--r-- | prisma/schema.prisma | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/prisma/migrations/20260215035919_test/migration.sql b/prisma/migrations/20260215035919_test/migration.sql new file mode 100644 index 0000000..8b85792 --- /dev/null +++ b/prisma/migrations/20260215035919_test/migration.sql @@ -0,0 +1,5 @@ +-- AlterTable +ALTER TABLE "Product" ADD COLUMN "locationId" INTEGER; + +-- AddForeignKey +ALTER TABLE "Product" ADD CONSTRAINT "Product_locationId_fkey" FOREIGN KEY ("locationId") REFERENCES "Location"("id") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 68bc387..bcbc9a2 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -33,6 +33,7 @@ model Location { name String company Company @relation(fields: [companyId], references: [id]) companyId Int + products Product[] stockOpnames StockOpname[] } @@ -48,6 +49,8 @@ model Product { isDifferent Boolean company Company @relation(fields: [companyId], references: [id]) companyId Int + location Location? @relation(fields: [locationId], references: [id]) + locationId Int? stockOpnames StockOpname[] } |
