
-- Script SQL de mise à jour v3.20
ALTER TABLE users 
  ADD COLUMN IF NOT EXISTS premium_since DATETIME NULL,
  ADD COLUMN IF NOT EXISTS author VARCHAR(100) NULL,
  ADD COLUMN IF NOT EXISTS is_invisible TINYINT(1) DEFAULT 0,
  ADD COLUMN IF NOT EXISTS ip_address VARCHAR(45) NULL;

ALTER TABLE settings
  ADD COLUMN IF NOT EXISTS maintenance_enabled TINYINT(1) DEFAULT 0,
  ADD COLUMN IF NOT EXISTS allow_guests TINYINT(1) DEFAULT 1,
  ADD COLUMN IF NOT EXISTS block_urls TINYINT(1) DEFAULT 1;

CREATE TABLE IF NOT EXISTS contact_inbox (
  id INT AUTO_INCREMENT PRIMARY KEY,
  sender VARCHAR(100),
  email VARCHAR(150),
  category VARCHAR(100),
  message TEXT,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
