procbay-schema 1.0.5 → 1.0.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "procbay-schema",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
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",
@@ -0,0 +1,42 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - A unique constraint covering the columns `[uuid]` on the table `budgets` will be added. If there are existing duplicate values, this will fail.
5
+ - A unique constraint covering the columns `[uuid]` on the table `category_budgets` will be added. If there are existing duplicate values, this will fail.
6
+ - A unique constraint covering the columns `[uuid]` on the table `department_budgets` will be added. If there are existing duplicate values, this will fail.
7
+ - A unique constraint covering the columns `[uuid]` on the table `expenses` will be added. If there are existing duplicate values, this will fail.
8
+ - A unique constraint covering the columns `[uuid]` on the table `supporting_documents` will be added. If there are existing duplicate values, this will fail.
9
+
10
+ */
11
+ -- AlterTable
12
+ ALTER TABLE "budgets" ADD COLUMN "uuid" TEXT;
13
+
14
+ -- AlterTable
15
+ ALTER TABLE "category_budgets" ADD COLUMN "uuid" TEXT;
16
+
17
+ -- AlterTable
18
+ ALTER TABLE "department_budgets" ADD COLUMN "uuid" TEXT;
19
+
20
+ -- AlterTable
21
+ ALTER TABLE "expenses" ADD COLUMN "uuid" TEXT;
22
+
23
+ -- AlterTable
24
+ ALTER TABLE "export_logs" ALTER COLUMN "expires_at" SET DEFAULT NOW() + INTERVAL '7 days';
25
+
26
+ -- AlterTable
27
+ ALTER TABLE "supporting_documents" ADD COLUMN "uuid" TEXT;
28
+
29
+ -- CreateIndex
30
+ CREATE UNIQUE INDEX "budgets_uuid_key" ON "budgets"("uuid");
31
+
32
+ -- CreateIndex
33
+ CREATE UNIQUE INDEX "category_budgets_uuid_key" ON "category_budgets"("uuid");
34
+
35
+ -- CreateIndex
36
+ CREATE UNIQUE INDEX "department_budgets_uuid_key" ON "department_budgets"("uuid");
37
+
38
+ -- CreateIndex
39
+ CREATE UNIQUE INDEX "expenses_uuid_key" ON "expenses"("uuid");
40
+
41
+ -- CreateIndex
42
+ CREATE UNIQUE INDEX "supporting_documents_uuid_key" ON "supporting_documents"("uuid");
@@ -0,0 +1,14 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - A unique constraint covering the columns `[code]` on the table `department_budgets` will be added. If there are existing duplicate values, this will fail.
5
+
6
+ */
7
+ -- AlterTable
8
+ ALTER TABLE "department_budgets" ADD COLUMN "code" TEXT;
9
+
10
+ -- AlterTable
11
+ ALTER TABLE "export_logs" ALTER COLUMN "expires_at" SET DEFAULT NOW() + INTERVAL '7 days';
12
+
13
+ -- CreateIndex
14
+ CREATE UNIQUE INDEX "department_budgets_code_key" ON "department_budgets"("code");
@@ -0,0 +1,97 @@
1
+ -- CreateEnum
2
+ CREATE TYPE "RequestedCatalogueStatusEnum" AS ENUM ('ACTIVE', 'COMPLETED');
3
+
4
+ -- CreateEnum
5
+ CREATE TYPE "RequestedCatalogueItemStatusEnum" AS ENUM ('ACTIVE', 'INACTIVE');
6
+
7
+ -- CreateEnum
8
+ CREATE TYPE "RequestedCatalogueVendorStatusEnum" AS ENUM ('PENDING', 'RESPONDED');
9
+
10
+ -- AlterTable
11
+ ALTER TABLE "export_logs" ALTER COLUMN "expires_at" SET DEFAULT NOW() + INTERVAL '7 days';
12
+
13
+ -- CreateTable
14
+ CREATE TABLE "requested_catalogues" (
15
+ "id" SERIAL NOT NULL,
16
+ "uuid" TEXT,
17
+ "code" TEXT,
18
+ "status" "RequestedCatalogueStatusEnum" DEFAULT 'ACTIVE',
19
+ "created_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
20
+ "created_by" INTEGER,
21
+ "updated_at" TIMESTAMPTZ(6) NOT NULL,
22
+ "updated_by" INTEGER,
23
+ "is_deleted" BOOLEAN NOT NULL DEFAULT false,
24
+ "deleted_at" TIMESTAMPTZ(6),
25
+ "deleted_by" INTEGER,
26
+
27
+ CONSTRAINT "requested_catalogues_pkey" PRIMARY KEY ("id")
28
+ );
29
+
30
+ -- CreateTable
31
+ CREATE TABLE "requested_catalogue_items" (
32
+ "id" SERIAL NOT NULL,
33
+ "uuid" TEXT,
34
+ "req_catalogue_id" INTEGER,
35
+ "item_id" INTEGER,
36
+ "status" "RequestedCatalogueItemStatusEnum" DEFAULT 'ACTIVE',
37
+ "created_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
38
+ "created_by" INTEGER,
39
+ "updated_at" TIMESTAMPTZ(6) NOT NULL,
40
+ "updated_by" INTEGER,
41
+ "is_deleted" BOOLEAN NOT NULL DEFAULT false,
42
+ "deleted_at" TIMESTAMPTZ(6),
43
+ "deleted_by" INTEGER,
44
+
45
+ CONSTRAINT "requested_catalogue_items_pkey" PRIMARY KEY ("id")
46
+ );
47
+
48
+ -- CreateTable
49
+ CREATE TABLE "requested_catalogue_vendors" (
50
+ "id" SERIAL NOT NULL,
51
+ "uuid" TEXT,
52
+ "req_catalogue_id" INTEGER,
53
+ "vendor_id" INTEGER,
54
+ "status" "RequestedCatalogueVendorStatusEnum" DEFAULT 'PENDING',
55
+ "created_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
56
+ "created_by" INTEGER,
57
+ "updated_at" TIMESTAMPTZ(6) NOT NULL,
58
+ "updated_by" INTEGER,
59
+ "is_deleted" BOOLEAN NOT NULL DEFAULT false,
60
+ "deleted_at" TIMESTAMPTZ(6),
61
+ "deleted_by" INTEGER,
62
+
63
+ CONSTRAINT "requested_catalogue_vendors_pkey" PRIMARY KEY ("id")
64
+ );
65
+
66
+ -- CreateIndex
67
+ CREATE UNIQUE INDEX "requested_catalogues_uuid_key" ON "requested_catalogues"("uuid");
68
+
69
+ -- CreateIndex
70
+ CREATE UNIQUE INDEX "requested_catalogues_code_key" ON "requested_catalogues"("code");
71
+
72
+ -- CreateIndex
73
+ CREATE UNIQUE INDEX "requested_catalogue_items_uuid_key" ON "requested_catalogue_items"("uuid");
74
+
75
+ -- CreateIndex
76
+ CREATE INDEX "requested_catalogue_items_req_catalogue_id_idx" ON "requested_catalogue_items"("req_catalogue_id");
77
+
78
+ -- CreateIndex
79
+ CREATE INDEX "requested_catalogue_items_item_id_idx" ON "requested_catalogue_items"("item_id");
80
+
81
+ -- CreateIndex
82
+ CREATE UNIQUE INDEX "requested_catalogue_vendors_uuid_key" ON "requested_catalogue_vendors"("uuid");
83
+
84
+ -- CreateIndex
85
+ CREATE INDEX "requested_catalogue_vendors_req_catalogue_id_idx" ON "requested_catalogue_vendors"("req_catalogue_id");
86
+
87
+ -- CreateIndex
88
+ CREATE INDEX "requested_catalogue_vendors_vendor_id_idx" ON "requested_catalogue_vendors"("vendor_id");
89
+
90
+ -- AddForeignKey
91
+ ALTER TABLE "requested_catalogue_items" ADD CONSTRAINT "requested_catalogue_items_req_catalogue_id_fkey" FOREIGN KEY ("req_catalogue_id") REFERENCES "requested_catalogues"("id") ON DELETE CASCADE ON UPDATE CASCADE;
92
+
93
+ -- AddForeignKey
94
+ ALTER TABLE "requested_catalogue_items" ADD CONSTRAINT "requested_catalogue_items_item_id_fkey" FOREIGN KEY ("item_id") REFERENCES "item"("id") ON DELETE CASCADE ON UPDATE CASCADE;
95
+
96
+ -- AddForeignKey
97
+ ALTER TABLE "requested_catalogue_vendors" ADD CONSTRAINT "requested_catalogue_vendors_req_catalogue_id_fkey" FOREIGN KEY ("req_catalogue_id") REFERENCES "requested_catalogues"("id") ON DELETE CASCADE ON UPDATE CASCADE;