updated structure in the table view
This commit is contained in:
@@ -36,59 +36,83 @@ CREATE TABLE IF NOT EXISTS dm_orders (
|
||||
-- PRODUCTION DATA TABLES
|
||||
-- =============================================
|
||||
|
||||
-- Production Orders Table (from Comenzi Productie)
|
||||
-- Production Orders Table (from Comenzi Productie - Production orders Data sheet)
|
||||
CREATE TABLE IF NOT EXISTS dm_production_orders (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
|
||||
-- Primary Identifiers
|
||||
production_order VARCHAR(50) UNIQUE NOT NULL,
|
||||
order_id VARCHAR(50),
|
||||
open_for_order_line VARCHAR(100), -- Concatenated: "Opened for Order" + "-" + "Linia"
|
||||
client_order_line VARCHAR(100), -- Concatenated: "Com. Achiz. Client" + "-" + "Nr. linie com. client"
|
||||
|
||||
-- Customer Information
|
||||
customer_code VARCHAR(50),
|
||||
customer_name VARCHAR(255),
|
||||
client_order VARCHAR(100),
|
||||
article_code VARCHAR(50),
|
||||
|
||||
-- Article Information
|
||||
article_code VARCHAR(100),
|
||||
article_description TEXT,
|
||||
quantity_requested INT,
|
||||
delivery_date DATE,
|
||||
production_status VARCHAR(50),
|
||||
unit_of_measure VARCHAR(20),
|
||||
|
||||
-- Dates
|
||||
delivery_date DATE, -- SO Duedate
|
||||
opening_date DATE, -- Data Deschiderii
|
||||
closing_date DATE, -- Data Inchiderii
|
||||
data_planificare DATE, -- Data Planific.
|
||||
|
||||
-- Production Status
|
||||
production_status VARCHAR(50), -- Status (Inchis, etc.)
|
||||
|
||||
-- Machine Information
|
||||
machine_code VARCHAR(50), -- Masina cusut
|
||||
machine_type VARCHAR(50), -- Tip masina
|
||||
machine_number VARCHAR(20), -- Machine Number
|
||||
|
||||
-- Production Timeline
|
||||
end_of_quilting DATETIME,
|
||||
end_of_sewing DATETIME,
|
||||
data_deschiderii DATE,
|
||||
data_planificare DATE,
|
||||
end_of_quilting DATE, -- End of Quilting
|
||||
end_of_sewing DATE, -- End of Sewing
|
||||
|
||||
-- Quality Control Stages
|
||||
t1_status DECIMAL(3,1),
|
||||
t1_registration_date DATETIME,
|
||||
t1_operator_name VARCHAR(100),
|
||||
t2_status DECIMAL(3,1),
|
||||
t2_registration_date DATETIME,
|
||||
t2_operator_name VARCHAR(100),
|
||||
t3_status DECIMAL(3,1),
|
||||
t3_registration_date DATETIME,
|
||||
t3_operator_name VARCHAR(100),
|
||||
-- Quality Control Phase T1 (Prepared)
|
||||
phase_t1_prepared VARCHAR(50), -- Faza pregatit(T1)
|
||||
t1_operator_name VARCHAR(100), -- Nume complet T1
|
||||
t1_registration_date DATETIME, -- Data inregistrare T1
|
||||
|
||||
-- Machine and Production Details
|
||||
machine_code VARCHAR(50),
|
||||
machine_type VARCHAR(50),
|
||||
machine_number VARCHAR(20),
|
||||
classification VARCHAR(100),
|
||||
design_number INT,
|
||||
needle_position INT,
|
||||
total_norm_time DECIMAL(8,2),
|
||||
model_lb2 VARCHAR(255),
|
||||
-- Quality Control Phase T2 (Cut/Quilted)
|
||||
phase_t2_cut VARCHAR(50), -- Faza taiat/matlasat(T2)
|
||||
t2_operator_name VARCHAR(100), -- Nume complet T2
|
||||
t2_registration_date DATETIME, -- Data inregistrare T2
|
||||
|
||||
-- Quality Control Phase T3 (Sewing)
|
||||
phase_t3_sewing VARCHAR(50), -- Faza cusut(T3)
|
||||
t3_operator_name VARCHAR(100), -- Nume complet T3
|
||||
t3_registration_date DATETIME, -- Data inregistrare T3
|
||||
|
||||
-- Additional Information
|
||||
design_number INT, -- Design number
|
||||
classification VARCHAR(100), -- Clasificare
|
||||
model_description VARCHAR(255), -- Descriere Model
|
||||
model_lb2 VARCHAR(255), -- Model Lb2
|
||||
needle_position DECIMAL(5,1), -- Needle Position
|
||||
needle_row VARCHAR(50), -- Needle row
|
||||
priority INT DEFAULT 0, -- Prioritate executie
|
||||
|
||||
-- Metadata
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
|
||||
-- Indexes for Performance
|
||||
INDEX idx_production_order (production_order),
|
||||
INDEX idx_order_id (order_id),
|
||||
INDEX idx_open_for_order_line (open_for_order_line),
|
||||
INDEX idx_client_order_line (client_order_line),
|
||||
INDEX idx_customer (customer_code),
|
||||
INDEX idx_article (article_code),
|
||||
INDEX idx_delivery_date (delivery_date),
|
||||
INDEX idx_status (production_status),
|
||||
INDEX idx_machine (machine_code),
|
||||
INDEX idx_quilting_date (end_of_quilting),
|
||||
INDEX idx_sewing_date (end_of_sewing)
|
||||
INDEX idx_sewing_date (end_of_sewing),
|
||||
INDEX idx_data_planificare (data_planificare)
|
||||
);
|
||||
|
||||
-- =============================================
|
||||
|
||||
Reference in New Issue
Block a user