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 MasterParameterHoldingTime VARCHAR(50), -- waktu simpan maksimum
MasterParameterRemarks TEXT, MasterParameterRemarks TEXT,
MasterParameterIsActive BOOLEAN DEFAULT TRUE, MasterParameterIsActive BOOLEAN DEFAULT TRUE,
CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP, MasterParameterCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
CreatedUserID INT, MasterParameterCreatedUserID INT,
UpdatedAt DATETIME, MasterParameterUpdatedAt DATETIME,
UpdatedUserID INT, MasterParameterUpdatedUserID INT,
DeletedAt DATETIME, MasterParameterDeletedAt DATETIME,
DeletedUserID INT MasterParameterDeletedUserID INT
); );
CREATE TABLE master_equipment ( CREATE TABLE master_equipment (
@@ -38,12 +38,12 @@ CREATE TABLE master_equipment (
MasterEquipmentLocation VARCHAR(100), -- lokasi penyimpanan MasterEquipmentLocation VARCHAR(100), -- lokasi penyimpanan
MasterEquipmentRemarks TEXT, MasterEquipmentRemarks TEXT,
MasterEquipmentIsActive BOOLEAN DEFAULT TRUE, MasterEquipmentIsActive BOOLEAN DEFAULT TRUE,
CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP, MasterEquipmentCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
CreatedUserID INT, MasterEquipmentCreatedUserID INT,
UpdatedAt DATETIME, MasterEquipmentUpdatedAt DATETIME,
UpdatedUserID INT, MasterEquipmentUpdatedUserID INT,
DeletedAt DATETIME, MasterEquipmentDeletedAt DATETIME,
DeletedUserID INT MasterEquipmentDeletedUserID INT
); );
CREATE TABLE master_personnel ( CREATE TABLE master_personnel (
@@ -61,12 +61,12 @@ CREATE TABLE master_personnel (
MasterPersonnelStatus VARCHAR(20), -- active, inactive MasterPersonnelStatus VARCHAR(20), -- active, inactive
MasterPersonnelRemarks TEXT, MasterPersonnelRemarks TEXT,
MasterPersonnelIsActive BOOLEAN DEFAULT TRUE, MasterPersonnelIsActive BOOLEAN DEFAULT TRUE,
CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP, MasterPersonnelCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
CreatedUserID INT, MasterPersonnelCreatedUserID INT,
UpdatedAt DATETIME, MasterPersonnelUpdatedAt DATETIME,
UpdatedUserID INT, MasterPersonnelUpdatedUserID INT,
DeletedAt DATETIME, MasterPersonnelDeletedAt DATETIME,
DeletedUserID INT MasterPersonnelDeletedUserID INT
); );
CREATE TABLE master_clients ( CREATE TABLE master_clients (
@@ -90,12 +90,12 @@ CREATE TABLE master_clients (
MasterClientStatus VARCHAR(20), -- active, inactive MasterClientStatus VARCHAR(20), -- active, inactive
MasterClientRemarks TEXT, MasterClientRemarks TEXT,
MasterClientIsActive BOOLEAN DEFAULT TRUE, MasterClientIsActive BOOLEAN DEFAULT TRUE,
CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP, MasterClientCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
CreatedUserID INT, MasterClientCreatedUserID INT,
UpdatedAt DATETIME, MasterClientUpdatedAt DATETIME,
UpdatedUserID INT, MasterClientUpdatedUserID INT,
DeletedAt DATETIME, MasterClientDeletedAt DATETIME,
DeletedUserID INT MasterClientDeletedUserID INT
); );
CREATE TABLE master_sampling_locations ( CREATE TABLE master_sampling_locations (
@@ -112,12 +112,12 @@ CREATE TABLE master_sampling_locations (
MasterSamplingLocationPointDetails TEXT, MasterSamplingLocationPointDetails TEXT,
MasterSamplingLocationRemarks TEXT, MasterSamplingLocationRemarks TEXT,
MasterSamplingLocationIsActive BOOLEAN DEFAULT TRUE, MasterSamplingLocationIsActive BOOLEAN DEFAULT TRUE,
CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP, MasterSamplingLocationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
CreatedUserID INT, MasterSamplingLocationCreatedUserID INT,
UpdatedAt DATETIME, MasterSamplingLocationUpdatedAt DATETIME,
UpdatedUserID INT, MasterSamplingLocationUpdatedUserID INT,
DeletedAt DATETIME, MasterSamplingLocationDeletedAt DATETIME,
DeletedUserID INT MasterSamplingLocationDeletedUserID INT
); );
CREATE TABLE master_sampling_methods ( CREATE TABLE master_sampling_methods (
@@ -133,12 +133,12 @@ CREATE TABLE master_sampling_methods (
MasterSamplingMethodLimitations TEXT, MasterSamplingMethodLimitations TEXT,
MasterSamplingMethodRemarks TEXT, MasterSamplingMethodRemarks TEXT,
MasterSamplingMethodIsActive BOOLEAN DEFAULT TRUE, MasterSamplingMethodIsActive BOOLEAN DEFAULT TRUE,
CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP, MasterSamplingMethodCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
CreatedUserID INT, MasterSamplingMethodCreatedUserID INT,
UpdatedAt DATETIME, MasterSamplingMethodUpdatedAt DATETIME,
UpdatedUserID INT, MasterSamplingMethodUpdatedUserID INT,
DeletedAt DATETIME, MasterSamplingMethodDeletedAt DATETIME,
DeletedUserID INT MasterSamplingMethodDeletedUserID INT
); );
CREATE TABLE master_preservation_methods ( CREATE TABLE master_preservation_methods (
@@ -403,6 +403,108 @@ CREATE TABLE measurement_results_light (
MeasurementResultLightDeletedUserID INT 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 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), (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), (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),