-- Server settings table for admin-configurable runtime parameters
-- MySQL/MariaDB

CREATE TABLE IF NOT EXISTS server_settings (
  id INT UNSIGNED NOT NULL AUTO_INCREMENT,
  setting_key VARCHAR(100) NOT NULL UNIQUE,
  setting_value VARCHAR(255) NOT NULL,
  updated_by INT UNSIGNED NULL,
  updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (id),
  UNIQUE KEY uk_setting_key (setting_key)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- Seed rows for known settings (optional; INSERT IGNORE keeps existing)
INSERT IGNORE INTO server_settings (setting_key, setting_value) VALUES
 ('server0_turnmin','0.05'),
 ('server0_turnmax','5000'),
 ('server0_dp','24'),
 ('counterExpireTime','168'),
 ('NPC_0_MinDP','0'),
 ('NPC_0_MaxDP','4'),
 ('NPC_0_MinPR_Default','30000'),
 ('NPC_0_MaxPR_Default','500000');


