feat: v6.5.0 Synced blocks production — pages contenu par lignes de DB, résolution serveur à chaque lecture, propagation écrite réelle
FlowDeck CI / lint (push) Successful in 1m27s
FlowDeck CI / test (push) Successful in 10m51s
FlowDeck CI / docker (push) Successful in 1m21s

This commit is contained in:
2026-09-24 08:28:25 -04:00
parent f2f2f3209e
commit 5951c707eb
16 changed files with 990 additions and 50 deletions
+24
View File
@@ -959,3 +959,27 @@ def _migration_sync_version_columns(conn: sqlite3.Connection) -> None:
UPDATE collections SET sync_version = sync_version + 1 WHERE id = NEW.id;
END"""
)
@register(22, "v6.5.0: database row content pages")
def _migration_row_content_pages(conn: sqlite3.Connection) -> None:
"""v6.5.0 — Synced blocks production: content for database rows.
A database row (``collection_pages``) gains a shadow ``pages`` row
(``pages.collection_row_id``) that carries the Notion-style block
content of the row: the full page editor, synced blocks, versions and
realtime all work on it unchanged.
``ON DELETE CASCADE``: deleting a database row deletes its content
page (and ``page_synced_blocks`` cascades from ``pages``).
"""
cols = {r[1] for r in conn.execute("PRAGMA table_info(pages)").fetchall()}
if "collection_row_id" not in cols:
conn.execute(
"ALTER TABLE pages ADD COLUMN collection_row_id INTEGER "
"REFERENCES collection_pages(id) ON DELETE CASCADE"
)
conn.execute(
"CREATE INDEX IF NOT EXISTS idx_pages_row "
"ON pages(collection_row_id) WHERE collection_row_id IS NOT NULL"
)