feat: Add order_for_labels table to database initialization

- Added order_for_labels table to initialize_db.py with columns:
  * comanda_productie: Production order code (indexed)
  * cod_articol: Article code
  * descr_com_prod: Production order description
  * cantitate: Quantity
  * com_achiz_client: Client purchase order
  * nr_linie_com_client: Client order line number
  * customer_name: Customer name
  * customer_article_number: Customer's article reference
  * open_for_order: Open for order flag
  * line_number: Line number reference
  * printed_labels: Print status (indexed, default 0)
  * data_livrara: Delivery date
  * dimensiune: Dimensions
  * Indexes on: comanda_productie, printed_labels, created_at
- Added order_for_labels schema verification to db_schema_verifier.py
- Table supports labels printing module with proper indexing for queries
- Timestamps: created_at, updated_at for audit trail
This commit is contained in:
Quality App Developer
2026-02-02 01:24:38 +02:00
parent 4f6e215398
commit aa9882c3b1
2 changed files with 52 additions and 0 deletions

View File

@@ -108,6 +108,7 @@ class SchemaVerifier:
'application_settings': self.get_application_settings_schema,
'audit_logs': self.get_audit_logs_schema,
'backup_schedules': self.get_backup_schedules_schema,
'order_for_labels': self.get_order_for_labels_schema,
}
for table_name, schema_getter in tables_to_verify.items():
@@ -371,3 +372,29 @@ class SchemaVerifier:
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
"""
@staticmethod
def get_order_for_labels_schema():
return """
CREATE TABLE IF NOT EXISTS order_for_labels (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
comanda_productie VARCHAR(50) NOT NULL,
cod_articol VARCHAR(50),
descr_com_prod TEXT,
cantitate DECIMAL(10, 2),
com_achiz_client VARCHAR(50),
nr_linie_com_client VARCHAR(50),
customer_name VARCHAR(255),
customer_article_number VARCHAR(100),
open_for_order TINYINT(1) DEFAULT 1,
line_number INT,
printed_labels TINYINT(1) DEFAULT 0,
data_livrara DATE,
dimensiune VARCHAR(50),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
INDEX idx_comanda_productie (comanda_productie),
INDEX idx_printed_labels (printed_labels),
INDEX idx_created_at (created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
"""