feat: Require scopeId cascade FK relation to crdt_scopes for synced tables (#79)

Co-authored-by: Marcelo Soares <marcelo.me.soares@gmail.com>
This commit is contained in:
Copilot 2026-06-21 10:02:08 -03:00 • committed by GitHub
commit 5642d9b94d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,7 +24,7 @@ The ownership link is:
fields:
id: UuidValue?, defaultPersist=random_v7
### Owner scope of this row. Maintained by the CRDT sync layer.
scopeId: int?, relation(optional, parent=crdt_scopes, onDelete=Cascade)
scopeId: int?, relation(parent=crdt_scopes, onDelete=Cascade)
```
`scopeId == null` remains valid persisted state, but it means the row is
@ -262,7 +262,7 @@ The error message should explain the allowed alternatives:
The implementation issue should add schema/initialize tests for:
- accepting `scopeId: int?, relation(optional, parent=crdt_scopes,
- accepting `scopeId: int?, relation(parent=crdt_scopes,
onDelete=Cascade)` on every synced table;
- rejecting `sync -> non-sync` restricted reference-table FKs with
`onDelete=Restrict` while the reference-data sync phase is absent;