This commit is contained in:
Marcelo
2025-11-28 09:11:59 -06:00
commit b66cb97f16
34 changed files with 17756 additions and 0 deletions

19
migration.sql Normal file
View File

@@ -0,0 +1,19 @@
-- Database Migration for Graph Reload and Work Order Persistence
-- Run this SQL on your plastico_oee database
-- Add cycle_count column to persist production cycles
ALTER TABLE work_orders ADD COLUMN cycle_count INT DEFAULT 0;
-- Add index for efficient graph queries by time range
CREATE INDEX idx_work_orders_updated_at ON work_orders(updated_at);
-- Verify columns exist
SELECT
COLUMN_NAME,
DATA_TYPE,
IS_NULLABLE,
COLUMN_DEFAULT
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'work_orders'
AND TABLE_SCHEMA = DATABASE()
ORDER BY ORDINAL_POSITION;