sozsoft-platform/configs/seeds/postgres/object/Mnt_T_WorkOrderMaterial.sql
2026-10-19 17:35:08 +03:00

26 lines
1.1 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

CREATE TABLE IF NOT EXISTS public."Mnt_T_WorkOrderMaterial"
(
"Id" uuid NOT NULL DEFAULT gen_random_uuid(),
"TenantId" uuid NULL,
"WorkOrderId" uuid NOT NULL,
"ProductId" uuid NOT NULL,
"Quantity" numeric(18, 4) NOT NULL DEFAULT 1,
"UomId" varchar(64) NOT NULL DEFAULT 'Adet',
"LocationId" uuid NULL,
"StockId" uuid NULL,
"LotNo" varchar(64) NULL,
"ConsumptionTransferId" uuid NULL,
"Description" varchar(256) NULL,
"CreationTime" timestamp NOT NULL DEFAULT (NOW() AT TIME ZONE 'UTC'),
"CreatorId" uuid NULL,
"LastModificationTime" timestamp NULL,
"LastModifierId" uuid NULL,
"IsDeleted" boolean NOT NULL DEFAULT FALSE,
"DeletionTime" timestamp NULL,
"DeleterId" uuid NULL,
CONSTRAINT "PK_Mnt_T_WorkOrderMaterial" PRIMARY KEY ("Id")
);
-- Tablo stok satırı seçimiyle kurulmadan önce oluşmuş veritabanında kolonlar eklenir.
ALTER TABLE public."Mnt_T_WorkOrderMaterial" ADD COLUMN IF NOT EXISTS "StockId" uuid NULL;
ALTER TABLE public."Mnt_T_WorkOrderMaterial" ADD COLUMN IF NOT EXISTS "LotNo" varchar(64) NULL;