-- isp_db repair: recreate app_settings if it is missing or broken ("doesn't exist in engine")
-- Run this in phpMyAdmin (SQL tab) or in mysql client.

USE isp_db;

-- If the table exists but is corrupted inside InnoDB, dropping it is the cleanest fix.
DROP TABLE IF EXISTS app_settings;

CREATE TABLE app_settings (
  setting_key   VARCHAR(100) NOT NULL PRIMARY KEY,
  setting_value LONGTEXT NULL,
  updated_at    TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
