@juliobrim/prisma-shared 1.0.31 → 1.0.33
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.
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- The primary key for the `product_batch` table will be changed. If it partially fails, the table could be left without primary key constraint.
|
|
5
|
+
- You are about to drop the column `quantity` on the `product_batch` table. All the data in the column will be lost.
|
|
6
|
+
- The `id` column on the `product_batch` table would be dropped and recreated. This will lead to data loss if there is data in the column.
|
|
7
|
+
- Added the required column `currentQuantity` to the `product_batch` table without a default value. This is not possible if the table is not empty.
|
|
8
|
+
- Added the required column `initialQuantity` to the `product_batch` table without a default value. This is not possible if the table is not empty.
|
|
9
|
+
|
|
10
|
+
*/
|
|
11
|
+
-- AlterTable
|
|
12
|
+
ALTER TABLE "public"."product_batch" DROP CONSTRAINT "product_batch_pkey",
|
|
13
|
+
DROP COLUMN "quantity",
|
|
14
|
+
ADD COLUMN "currentQuantity" DOUBLE PRECISION NOT NULL,
|
|
15
|
+
ADD COLUMN "initialQuantity" DOUBLE PRECISION NOT NULL,
|
|
16
|
+
ADD COLUMN "internalBatchNumber" TEXT,
|
|
17
|
+
DROP COLUMN "id",
|
|
18
|
+
ADD COLUMN "id" SERIAL NOT NULL,
|
|
19
|
+
ADD CONSTRAINT "product_batch_pkey" PRIMARY KEY ("id");
|
package/package.json
CHANGED
package/schema.prisma
CHANGED
|
@@ -879,16 +879,19 @@ model DeviceOperator {
|
|
|
879
879
|
}
|
|
880
880
|
|
|
881
881
|
model ProductBatch {
|
|
882
|
-
id
|
|
883
|
-
productId
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
882
|
+
id Int @id @default(autoincrement())
|
|
883
|
+
productId String
|
|
884
|
+
supplier String?
|
|
885
|
+
batchNumber String
|
|
886
|
+
internalBatchNumber String?
|
|
887
|
+
initialQuantity Float // Quantidade inicial adicionada ao estoque
|
|
888
|
+
currentQuantity Float // Quantidade atual disponível
|
|
889
|
+
expiryDate DateTime @db.Date
|
|
890
|
+
createdAt DateTime @default(now())
|
|
891
|
+
updatedAt DateTime @updatedAt
|
|
892
|
+
tenantId String?
|
|
893
|
+
product Product @relation(fields: [productId], references: [id], onDelete: Cascade)
|
|
894
|
+
tenant Tenant? @relation(fields: [tenantId], references: [id], onDelete: Cascade)
|
|
892
895
|
|
|
893
896
|
@@unique([productId, batchNumber])
|
|
894
897
|
@@map("product_batch")
|