[
  {
    "type": "alter_table",
    "description": "Add email column to employees table for contact information",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'email'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `email` varchar(255) DEFAULT NULL AFTER `employeeLastName`"
  },
  {
    "type": "alter_table",
    "description": "Add phone column to employees table for contact information",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'phone'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `phone` varchar(20) DEFAULT NULL AFTER `email`"
  },
  {
    "type": "alter_table",
    "description": "Add photoUrl column to employees table for profile photos",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'photoUrl'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `photoUrl` varchar(500) DEFAULT NULL AFTER `phone`"
  },
  {
    "type": "alter_table",
    "description": "Add emergencyContactName column to employees table",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'emergencyContactName'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `emergencyContactName` varchar(100) DEFAULT NULL AFTER `photoUrl`"
  },
  {
    "type": "alter_table",
    "description": "Add emergencyContactPhone column to employees table",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'emergencyContactPhone'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `emergencyContactPhone` varchar(20) DEFAULT NULL AFTER `emergencyContactName`"
  },
  {
    "type": "alter_table",
    "description": "Add hireDate column to employees table for employment lifecycle tracking",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'hireDate'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `hireDate` date DEFAULT NULL AFTER `emergencyContactPhone`"
  },
  {
    "type": "alter_table",
    "description": "Add terminationDate column to employees table for employment lifecycle tracking",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'terminationDate'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `terminationDate` date DEFAULT NULL AFTER `hireDate`"
  },
  {
    "type": "alter_table",
    "description": "Add leaveStartDate column to employees table for leave tracking",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'leaveStartDate'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `leaveStartDate` date DEFAULT NULL AFTER `terminationDate`"
  },
  {
    "type": "alter_table",
    "description": "Add leaveEndDate column to employees table for leave tracking",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'leaveEndDate'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `leaveEndDate` date DEFAULT NULL AFTER `leaveStartDate`"
  },
  {
    "type": "alter_table",
    "description": "Add source column to employees table for tracking provider origin",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'source'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `source` enum('homegrown','wheniwork','homebase') DEFAULT 'homegrown' AFTER `leaveEndDate`"
  },
  {
    "type": "alter_table",
    "description": "Add externalId column to employees table for WhenIWork/Homebase user ID",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'externalId'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `externalId` varchar(50) DEFAULT NULL COMMENT 'WhenIWork or Homebase user ID' AFTER `source`"
  },
  {
    "type": "alter_table",
    "description": "Add drsEmployeeId column to employees table for DRS system integration",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'drsEmployeeId'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `drsEmployeeId` varchar(50) DEFAULT NULL COMMENT 'DRS system employee ID' AFTER `externalId`"
  },
  {
    "type": "alter_table",
    "description": "Add dailyEmailEnabled column to employees table for email preferences",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'dailyEmailEnabled'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `dailyEmailEnabled` tinyint(1) unsigned DEFAULT 0 AFTER `drsEmployeeId`"
  },
  {
    "type": "alter_table",
    "description": "Add position column to employees table for job title",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'position'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `position` varchar(100) DEFAULT NULL AFTER `dailyEmailEnabled`"
  },
  {
    "type": "alter_table",
    "description": "Add hourlyRate column to employees table for pay rate tracking",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'hourlyRate'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `hourlyRate` decimal(10,2) DEFAULT NULL AFTER `position`"
  },
  {
    "type": "alter_table",
    "description": "Add lastSyncedAt column to employees table for sync tracking",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'lastSyncedAt'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `lastSyncedAt` timestamp NULL DEFAULT NULL AFTER `hourlyRate`"
  },
  {
    "type": "alter_table",
    "description": "Add createdAt column to employees table for record tracking",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'createdAt'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `createdAt` timestamp NOT NULL DEFAULT current_timestamp() AFTER `lastSyncedAt`"
  },
  {
    "type": "alter_table",
    "description": "Add updatedAt column to employees table for record tracking",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM employees LIKE 'updatedAt'",
    "sql": "ALTER TABLE `employees` ADD COLUMN `updatedAt` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp() AFTER `createdAt`"
  },
  {
    "type": "alter_table",
    "description": "Add index on source column for filtering by provider",
    "database": "{{store}}",
    "check_query": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'employees' AND COLUMN_NAME = 'source') UNION SELECT INDEX_NAME FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'employees' AND INDEX_NAME = 'idx_source'",
    "sql": "ALTER TABLE `employees` ADD INDEX `idx_source` (`source`)"
  },
  {
    "type": "alter_table",
    "description": "Add index on externalId column for provider sync lookups",
    "database": "{{store}}",
    "check_query": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'employees' AND COLUMN_NAME = 'externalId') UNION SELECT INDEX_NAME FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'employees' AND INDEX_NAME = 'idx_externalId'",
    "sql": "ALTER TABLE `employees` ADD INDEX `idx_externalId` (`externalId`)"
  },
  {
    "type": "alter_table",
    "description": "Add index on active column for filtering active employees",
    "database": "{{store}}",
    "check_query": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'employees' AND COLUMN_NAME = 'active') UNION SELECT INDEX_NAME FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'employees' AND INDEX_NAME = 'idx_active'",
    "sql": "ALTER TABLE `employees` ADD INDEX `idx_active` (`active`)"
  },
  {
    "type": "alter_table",
    "description": "Add index on email column for lookups",
    "database": "{{store}}",
    "check_query": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'employees' AND COLUMN_NAME = 'email') UNION SELECT INDEX_NAME FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'employees' AND INDEX_NAME = 'idx_email'",
    "sql": "ALTER TABLE `employees` ADD INDEX `idx_email` (`email`)"
  }
]
