|
|
@@ -30,6 +30,29 @@ try {
|
|
|
$db->execute($settingsIndexSQL);
|
|
|
echo " Settings table index checked/created\n";
|
|
|
|
|
|
+ // Migration: Create pages table
|
|
|
+ $pagesTableSQL = "
|
|
|
+ CREATE TABLE IF NOT EXISTS pages (
|
|
|
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
+ name VARCHAR(255) NOT NULL,
|
|
|
+ slug VARCHAR(255) UNIQUE NOT NULL,
|
|
|
+ title VARCHAR(255),
|
|
|
+ content TEXT,
|
|
|
+ extra_fields JSON,
|
|
|
+ layout VARCHAR(255) DEFAULT 'default',
|
|
|
+ is_homepage BOOLEAN DEFAULT 0,
|
|
|
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
|
+ updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
|
+ )";
|
|
|
+
|
|
|
+ $db->execute($pagesTableSQL);
|
|
|
+ echo " Pages table checked/created\n";
|
|
|
+
|
|
|
+ // Create index for pages table
|
|
|
+ $pagesIndexSQL = "CREATE INDEX IF NOT EXISTS idx_pages_slug ON pages(slug)";
|
|
|
+ $db->execute($pagesIndexSQL);
|
|
|
+ echo " Pages table index checked/created\n";
|
|
|
+
|
|
|
|
|
|
// Insert default settings if they don't exist
|
|
|
$defaultSettings = [
|