39038-vm/db/migrations/add_settings_table.php
2026-03-14 05:41:22 +00:00

26 lines
853 B
PHP

<?php
require_once __DIR__ . '/../config.php';
$pdo = db();
try {
$pdo->exec("
CREATE TABLE IF NOT EXISTS settings (
setting_key VARCHAR(50) PRIMARY KEY,
setting_value TEXT
);
INSERT IGNORE INTO settings (setting_key, setting_value) VALUES
('company_name', 'My Transport Company'),
('company_email', 'info@example.com'),
('company_phone', '+1234567890'),
('company_address', '123 Transport St, City, Country'),
('platform_charge_percentage', '0'),
('logo_path', ''),
('favicon_path', ''),
('timezone', 'UTC'),
('whatsapp_enabled', '0'),
('wablas_domain', ''),
('wablas_api_token', '');
");
echo "Settings table created/updated.\n";
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
}