-- Drop legacy is_active column if exists (MySQL 5.7/8.0 compatible)
SET @exists := (
  SELECT COUNT(*)
  FROM INFORMATION_SCHEMA.COLUMNS
  WHERE TABLE_SCHEMA='nex_basse'
    AND TABLE_NAME='sys_user'
    AND COLUMN_NAME='is_active'
);
SET @sql := IF(@exists=1, 'ALTER TABLE sys_user DROP COLUMN is_active', 'SELECT 1');
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
