USE zylon_db;

ALTER TABLE users
  ADD COLUMN full_name VARCHAR(120) NOT NULL DEFAULT '' AFTER id;

ALTER TABLE users
  MODIFY COLUMN role VARCHAR(30) NOT NULL DEFAULT 'customer';

ALTER TABLE products
  ADD COLUMN discount_percent INT NOT NULL DEFAULT 0 AFTER image_url;

CREATE TABLE IF NOT EXISTS site_settings (
  id INT AUTO_INCREMENT PRIMARY KEY,
  setting_key VARCHAR(120) NOT NULL UNIQUE,
  setting_value TEXT NOT NULL,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
