-- install/sql/schema.sql
CREATE TABLE IF NOT EXISTS app_options (
  id INT AUTO_INCREMENT PRIMARY KEY,
  opt_key VARCHAR(100) UNIQUE NOT NULL,
  opt_value TEXT NULL,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS users (
  id INT AUTO_INCREMENT PRIMARY KEY,
  email VARCHAR(190) UNIQUE NOT NULL,
  password_hash VARCHAR(255) NOT NULL,
  role VARCHAR(50) DEFAULT 'admin',
  is_active TINYINT(1) DEFAULT 1,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

INSERT IGNORE INTO app_options (opt_key, opt_value) VALUES
('base_url','https://distibilisim.motadataserviceops.com'),
('api_endpoint_offset','16'),
('default_language','TR'),
('theme_mode','light');
