procbay-schema 1.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/prisma/migrations/20250909084050_init_catalogue_vendor_table/migration.sql +0 -0
- package/prisma/migrations/20250909121726_alter_requested_catalogue_detail_status/migration.sql +0 -0
- package/prisma/migrations/20250909125931_giot_push/migration.sql +0 -0
- package/prisma/migrations/20250911110904_alter_catalogue_vendor_table/migration.sql +12 -0
- package/prisma/schema.prisma +10 -4
- package/src/prisma/edge.js +5 -3
- package/src/prisma/index-browser.js +2 -0
- package/src/prisma/index.d.ts +1597 -239
- package/src/prisma/index.js +5 -3
- package/src/prisma/package.json +1 -1
- package/src/prisma/schema.prisma +10 -4
- package/src/prisma/wasm.js +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "procbay-schema",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"description": "A set of utilities for managing Prisma database schemas, seeding, and maintenance operations for the Procure-to-Pay system",
|
|
5
5
|
"main": "src/prisma/index.js",
|
|
6
6
|
"type": "module",
|
|
File without changes
|
package/prisma/migrations/20250909121726_alter_requested_catalogue_detail_status/migration.sql
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
-- AlterTable
|
|
2
|
+
ALTER TABLE "catalogue_vendor" ADD COLUMN "item_id" INTEGER,
|
|
3
|
+
ADD COLUMN "variant_id" INTEGER;
|
|
4
|
+
|
|
5
|
+
-- AlterTable
|
|
6
|
+
ALTER TABLE "export_logs" ALTER COLUMN "expires_at" SET DEFAULT NOW() + INTERVAL '7 days';
|
|
7
|
+
|
|
8
|
+
-- AddForeignKey
|
|
9
|
+
ALTER TABLE "catalogue_vendor" ADD CONSTRAINT "catalogue_vendor_item_id_fkey" FOREIGN KEY ("item_id") REFERENCES "item"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
10
|
+
|
|
11
|
+
-- AddForeignKey
|
|
12
|
+
ALTER TABLE "catalogue_vendor" ADD CONSTRAINT "catalogue_vendor_variant_id_fkey" FOREIGN KEY ("variant_id") REFERENCES "item"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
package/prisma/schema.prisma
CHANGED
|
@@ -390,8 +390,10 @@ model Item {
|
|
|
390
390
|
purchase_order_items PurchaseOrderItem[]
|
|
391
391
|
requested_catalogue_items RequestedCatalogueDetails[] @relation("ParentItemRequests")
|
|
392
392
|
requested_catalogue_variants RequestedCatalogueDetails[] @relation("VariantItemRequests")
|
|
393
|
-
catalogue_items Catalogue[] @relation("
|
|
394
|
-
catalogue_variants Catalogue[] @relation("
|
|
393
|
+
catalogue_items Catalogue[] @relation("ParentItemCatalogue")
|
|
394
|
+
catalogue_variants Catalogue[] @relation("VariantItemCatalogue")
|
|
395
|
+
catalogue_vendor_items CatalogueVendor[] @relation("ParentItemCatalogueVendor")
|
|
396
|
+
catalogue_vendor_variants CatalogueVendor[] @relation("VariantItemCatalogueVendor")
|
|
395
397
|
|
|
396
398
|
@@unique([item_handler, item_name])
|
|
397
399
|
@@index([parent_id, is_active, is_deleted]) // For variant queries
|
|
@@ -2555,9 +2557,9 @@ model Catalogue {
|
|
|
2555
2557
|
uuid String @unique @default(uuid())
|
|
2556
2558
|
req_catalogue_id Int?
|
|
2557
2559
|
item_id Int?
|
|
2558
|
-
parent_item Item? @relation("
|
|
2560
|
+
parent_item Item? @relation("ParentItemCatalogue", fields: [item_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
2559
2561
|
variant_id Int?
|
|
2560
|
-
variant Item? @relation("
|
|
2562
|
+
variant Item? @relation("VariantItemCatalogue", fields: [variant_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
2561
2563
|
status CatalogueStatusEnum @default(ACTIVE)
|
|
2562
2564
|
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
|
2563
2565
|
created_by Int?
|
|
@@ -2588,6 +2590,10 @@ model CatalogueVendor {
|
|
|
2588
2590
|
uuid String @unique @default(uuid())
|
|
2589
2591
|
catalogue_id Int?
|
|
2590
2592
|
catalogue Catalogue? @relation(fields: [catalogue_id], references: [id], onDelete: Cascade)
|
|
2593
|
+
item_id Int?
|
|
2594
|
+
parent_item Item? @relation("ParentItemCatalogueVendor", fields: [item_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
2595
|
+
variant_id Int?
|
|
2596
|
+
variant Item? @relation("VariantItemCatalogueVendor", fields: [variant_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
2591
2597
|
vendor_id Int?
|
|
2592
2598
|
stock Int?
|
|
2593
2599
|
price Decimal? @db.Decimal(15, 2)
|