-- ========================================
-- COMPLETE DEPLOYMENT SCRIPT
-- Positions & Roles to Production
-- ========================================
-- Single file with everything - no table locking issues
-- Run this ONE file in phpMyAdmin
-- ========================================

USE m1_erp;

-- Ensure no locks
UNLOCK TABLES;

-- Show before state
SELECT '=== BEFORE SYNC ===' as Info;
SELECT COUNT(*) as current_positions FROM positions;
SELECT COUNT(*) as current_roles FROM roles;

-- Create backups
DROP TABLE IF EXISTS positions_backup_20260210;
CREATE TABLE positions_backup_20260210 AS SELECT * FROM positions;

DROP TABLE IF EXISTS roles_backup_20260210;
CREATE TABLE roles_backup_20260210 AS SELECT * FROM roles;

SELECT 'Backups created' as Status;

-- Now we'll embed the data directly in this script
-- Continue below with INSERT statements...

