SET @courses_order_form_schema_exists := (
  SELECT COUNT(*) FROM information_schema.columns
  WHERE table_schema = DATABASE() AND table_name = 'courses' AND column_name = 'order_form_schema'
);
SET @courses_order_form_schema_sql := IF(
  @courses_order_form_schema_exists = 0,
  'ALTER TABLE courses ADD COLUMN order_form_schema JSON NULL AFTER after_sales_note',
  'SELECT 1'
);
PREPARE courses_order_form_schema_stmt FROM @courses_order_form_schema_sql;
EXECUTE courses_order_form_schema_stmt;
DEALLOCATE PREPARE courses_order_form_schema_stmt;
