-- database/superadmin_upgrades.sql
USE restpo;

-- 1. Create system_settings table
CREATE TABLE IF NOT EXISTS `system_settings` (
  `setting_key` VARCHAR(50) NOT NULL PRIMARY KEY,
  `setting_value` TEXT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- 2. Add extra_features JSON column to restaurants
ALTER TABLE `restaurants` 
  ADD COLUMN IF NOT EXISTS `extra_features` JSON NULL AFTER `package_id`;

-- 3. Modify status in subscriptions table to support pending status
ALTER TABLE `subscriptions` 
  MODIFY COLUMN `status` ENUM('active', 'expired', 'cancelled', 'pending') DEFAULT 'pending';
