This commit is contained in:
sas.fajri
2025-04-24 14:51:42 +07:00
parent fbf59c3376
commit 044e5eb0fc

View File

@@ -13,12 +13,12 @@ CREATE TABLE master_parameters (
MasterParameterHoldingTime VARCHAR(50), -- waktu simpan maksimum
MasterParameterRemarks TEXT,
MasterParameterIsActive BOOLEAN DEFAULT TRUE,
CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
CreatedUserID INT,
UpdatedAt DATETIME,
UpdatedUserID INT,
DeletedAt DATETIME,
DeletedUserID INT
MasterParameterCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
MasterParameterCreatedUserID INT,
MasterParameterUpdatedAt DATETIME,
MasterParameterUpdatedUserID INT,
MasterParameterDeletedAt DATETIME,
MasterParameterDeletedUserID INT
);
CREATE TABLE master_equipment (
@@ -38,12 +38,12 @@ CREATE TABLE master_equipment (
MasterEquipmentLocation VARCHAR(100), -- lokasi penyimpanan
MasterEquipmentRemarks TEXT,
MasterEquipmentIsActive BOOLEAN DEFAULT TRUE,
CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
CreatedUserID INT,
UpdatedAt DATETIME,
UpdatedUserID INT,
DeletedAt DATETIME,
DeletedUserID INT
MasterEquipmentCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
MasterEquipmentCreatedUserID INT,
MasterEquipmentUpdatedAt DATETIME,
MasterEquipmentUpdatedUserID INT,
MasterEquipmentDeletedAt DATETIME,
MasterEquipmentDeletedUserID INT
);
CREATE TABLE master_personnel (
@@ -61,12 +61,12 @@ CREATE TABLE master_personnel (
MasterPersonnelStatus VARCHAR(20), -- active, inactive
MasterPersonnelRemarks TEXT,
MasterPersonnelIsActive BOOLEAN DEFAULT TRUE,
CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
CreatedUserID INT,
UpdatedAt DATETIME,
UpdatedUserID INT,
DeletedAt DATETIME,
DeletedUserID INT
MasterPersonnelCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
MasterPersonnelCreatedUserID INT,
MasterPersonnelUpdatedAt DATETIME,
MasterPersonnelUpdatedUserID INT,
MasterPersonnelDeletedAt DATETIME,
MasterPersonnelDeletedUserID INT
);
CREATE TABLE master_clients (
@@ -90,12 +90,12 @@ CREATE TABLE master_clients (
MasterClientStatus VARCHAR(20), -- active, inactive
MasterClientRemarks TEXT,
MasterClientIsActive BOOLEAN DEFAULT TRUE,
CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
CreatedUserID INT,
UpdatedAt DATETIME,
UpdatedUserID INT,
DeletedAt DATETIME,
DeletedUserID INT
MasterClientCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
MasterClientCreatedUserID INT,
MasterClientUpdatedAt DATETIME,
MasterClientUpdatedUserID INT,
MasterClientDeletedAt DATETIME,
MasterClientDeletedUserID INT
);
CREATE TABLE master_sampling_locations (
@@ -112,12 +112,12 @@ CREATE TABLE master_sampling_locations (
MasterSamplingLocationPointDetails TEXT,
MasterSamplingLocationRemarks TEXT,
MasterSamplingLocationIsActive BOOLEAN DEFAULT TRUE,
CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
CreatedUserID INT,
UpdatedAt DATETIME,
UpdatedUserID INT,
DeletedAt DATETIME,
DeletedUserID INT
MasterSamplingLocationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
MasterSamplingLocationCreatedUserID INT,
MasterSamplingLocationUpdatedAt DATETIME,
MasterSamplingLocationUpdatedUserID INT,
MasterSamplingLocationDeletedAt DATETIME,
MasterSamplingLocationDeletedUserID INT
);
CREATE TABLE master_sampling_methods (
@@ -133,12 +133,12 @@ CREATE TABLE master_sampling_methods (
MasterSamplingMethodLimitations TEXT,
MasterSamplingMethodRemarks TEXT,
MasterSamplingMethodIsActive BOOLEAN DEFAULT TRUE,
CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
CreatedUserID INT,
UpdatedAt DATETIME,
UpdatedUserID INT,
DeletedAt DATETIME,
DeletedUserID INT
MasterSamplingMethodCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
MasterSamplingMethodCreatedUserID INT,
MasterSamplingMethodUpdatedAt DATETIME,
MasterSamplingMethodUpdatedUserID INT,
MasterSamplingMethodDeletedAt DATETIME,
MasterSamplingMethodDeletedUserID INT
);
CREATE TABLE master_preservation_methods (
@@ -403,6 +403,108 @@ CREATE TABLE measurement_results_light (
MeasurementResultLightDeletedUserID INT
);
CREATE TABLE master_analysis_methods (
MasterAnalysisMethodID INT PRIMARY KEY AUTO_INCREMENT,
MasterAnalysisMethodCode VARCHAR(20) NOT NULL,
MasterAnalysisMethodName VARCHAR(100) NOT NULL,
MasterAnalysisMethodReference VARCHAR(100),
MasterAnalysisMethodDescription TEXT,
MasterAnalysisMethodPrinciple TEXT,
MasterAnalysisMethodInterference TEXT,
MasterAnalysisMethodEquipment TEXT,
MasterAnalysisMethodReagent TEXT,
MasterAnalysisMethodProcedure TEXT,
MasterAnalysisMethodCalculation TEXT,
MasterAnalysisMethodQC TEXT,
MasterAnalysisMethodMDL DECIMAL(10,4),
MasterAnalysisMethodIsActive BOOLEAN DEFAULT TRUE,
MasterAnalysisMethodCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
MasterAnalysisMethodCreatedUserID INT,
MasterAnalysisMethodUpdatedAt DATETIME,
MasterAnalysisMethodUpdatedUserID INT,
MasterAnalysisMethodDeletedAt DATETIME,
MasterAnalysisMethodDeletedUserID INT
);
CREATE TABLE master_matrix_types (
MasterMatrixTypeID INT PRIMARY KEY AUTO_INCREMENT,
MasterMatrixTypeCode VARCHAR(20) NOT NULL,
MasterMatrixTypeName VARCHAR(100) NOT NULL,
MasterMatrixTypeDescription TEXT,
MasterMatrixTypePreservation TEXT,
MasterMatrixTypeHoldingTime VARCHAR(50),
MasterMatrixTypeIsActive BOOLEAN DEFAULT TRUE,
MasterMatrixTypeCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
MasterMatrixTypeCreatedUserID INT,
MasterMatrixTypeUpdatedAt DATETIME,
MasterMatrixTypeUpdatedUserID INT,
MasterMatrixTypeDeletedAt DATETIME,
MasterMatrixTypeDeletedUserID INT
);
CREATE TABLE master_sample_types (
MasterSampleTypeID INT PRIMARY KEY AUTO_INCREMENT,
MasterMatrixTypeID INT,
MasterSampleTypeCode VARCHAR(20) NOT NULL,
MasterSampleTypeName VARCHAR(100) NOT NULL,
MasterSampleTypeDescription TEXT,
MasterSampleTypeVolume DECIMAL(10,2),
MasterSampleTypeUnit VARCHAR(20),
MasterSampleTypeIsActive BOOLEAN DEFAULT TRUE,
MasterSampleTypeCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
MasterSampleTypeCreatedUserID INT,
MasterSampleTypeUpdatedAt DATETIME,
MasterSampleTypeUpdatedUserID INT,
MasterSampleTypeDeletedAt DATETIME,
MasterSampleTypeDeletedUserID INT
);
CREATE TABLE master_units (
MasterUnitID INT PRIMARY KEY AUTO_INCREMENT,
MasterUnitCode VARCHAR(20) NOT NULL,
MasterUnitName VARCHAR(100) NOT NULL,
MasterUnitSymbol VARCHAR(20),
MasterUnitType VARCHAR(50),
MasterUnitDescription TEXT,
MasterUnitIsActive BOOLEAN DEFAULT TRUE,
MasterUnitCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
MasterUnitCreatedUserID INT,
MasterUnitUpdatedAt DATETIME,
MasterUnitUpdatedUserID INT,
MasterUnitDeletedAt DATETIME,
MasterUnitDeletedUserID INT
);
CREATE TABLE master_payment_terms (
MasterPaymentTermID INT PRIMARY KEY AUTO_INCREMENT,
MasterPaymentTermCode VARCHAR(20) NOT NULL,
MasterPaymentTermName VARCHAR(100) NOT NULL,
MasterPaymentTermDays INT,
MasterPaymentTermDescription TEXT,
MasterPaymentTermIsActive BOOLEAN DEFAULT TRUE,
MasterPaymentTermCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
MasterPaymentTermCreatedUserID INT,
MasterPaymentTermUpdatedAt DATETIME,
MasterPaymentTermUpdatedUserID INT,
MasterPaymentTermDeletedAt DATETIME,
MasterPaymentTermDeletedUserID INT
);
CREATE TABLE master_client_categories (
MasterClientCategoryID INT PRIMARY KEY AUTO_INCREMENT,
MasterClientCategoryCode VARCHAR(20) NOT NULL,
MasterClientCategoryName VARCHAR(100) NOT NULL,
MasterClientCategoryDescription TEXT,
MasterClientCategoryDiscountRate DECIMAL(5,2),
MasterClientCategoryIsActive BOOLEAN DEFAULT TRUE,
MasterClientCategoryCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
MasterClientCategoryCreatedUserID INT,
MasterClientCategoryUpdatedAt DATETIME,
MasterClientCategoryUpdatedUserID INT,
MasterClientCategoryDeletedAt DATETIME,
MasterClientCategoryDeletedUserID INT
);
INSERT INTO master_parameters (MasterParameterID, MasterParameterCode, MasterParameterName, MasterParameterGroup, MasterParameterStandardMethod, MasterParameterUnit, MasterParameterPrice, MasterParameterInstrumentation, MasterParameterMDL, MasterParameterContainerType, MasterParameterPreservation, MasterParameterHoldingTime, MasterParameterRemarks, MasterParameterIsActive) VALUES
(1, 'pH', 'pH', 'Fisika', 'SNI 06-6989.11-2019', 'unit', 50000.00, 'pH meter', 0.01, 'HDPE/Glass', 'Analisis segera', '15 menit (lapangan) / 24 jam', 'Parameter lapangan, prioritas analisis', TRUE),
(2, 'TSS', 'Total Suspended Solid', 'Fisika', 'SNI 06-6989.3-2019', 'mg/L', 75000.00, 'Analytical Balance, Oven', 1.00, 'HDPE/Glass', 'Pendinginan 4°C', '7 hari', NULL, TRUE),