Scope article feeds and expand canvas editing

This commit is contained in:
2026-11-21 22:55:59 +08:00
parent a2fc628f08
commit 9bc0ee0e45
32 changed files with 476 additions and 67 deletions
+6
View File
@@ -44,6 +44,12 @@ final class Database
throw new RuntimeException('请将 LAYSENSE_DB 指向一个新的 SQLite 文件,再运行安装命令。');
}
$pdo->exec(file_get_contents($root . '/resources/schema.sql'));
foreach (['pages', 'sections'] as $table) {
$columns = array_column($pdo->query('PRAGMA table_info(' . $table . ')')->fetchAll(), 'name');
if (!in_array('alignments', $columns, true)) {
$pdo->exec("ALTER TABLE $table ADD COLUMN alignments TEXT NOT NULL DEFAULT '{}'");
}
}
$site = $pdo->prepare('INSERT OR IGNORE INTO site_settings (id, payload) VALUES (1, ?)');
$site->execute([self::json($seed['site'])]);