Seed editable default header and footer pages

This commit is contained in:
2026-11-23 21:21:41 +08:00
parent 74355914d9
commit e2a0db9cd5
10 changed files with 62 additions and 10 deletions
+3 -1
View File
@@ -11,7 +11,7 @@ use Throwable;
final class Database
{
private const SCHEMA_VERSION = 4;
private const SCHEMA_VERSION = 5;
// Avoid reusing a deleted ID that may still be open in an editing form.
public const NEXT_ARTICLE_ID = 'MAX(COALESCE((SELECT MAX(id) FROM articles), 0),
COALESCE((SELECT MAX(article_id) FROM article_deletions), 0)) + 1';
@@ -88,6 +88,8 @@ final class Database
$pdo->exec('ALTER TABLE pages ADD COLUMN layout_id INTEGER REFERENCES design_presets(id)');
}
$pdo->exec('CREATE UNIQUE INDEX IF NOT EXISTS pages_layout_id ON pages(layout_id)');
}
if ($version < 5) {
LayoutPage::migrate($pdo);
}
if ($version < self::SCHEMA_VERSION) {