-- Slice 8b-1 · Field Supervisor as a first-class project seat
-- Mirrors the pc_id / pc_name pattern.
SET @sql := (SELECT IF(COUNT(*) = 0,
    'ALTER TABLE c_projects
        ADD COLUMN fs_id INT NOT NULL DEFAULT 0 AFTER procurement_name,
        ADD COLUMN fs_name VARCHAR(120) NOT NULL DEFAULT "" AFTER fs_id',
    'SELECT "c_projects.fs_id already exists"'
) FROM information_schema.columns
  WHERE table_schema = DATABASE() AND table_name = 'c_projects' AND column_name = 'fs_id');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
