fix: Allow only one releasable column per unique index (#91)

This commit is contained in:
Marcelo Mendonça Soares 2026-07-03 10:49:23 -03:00 • committed by GitHub
commit af139ea800
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 353 additions and 112 deletions

View file

@ -24,6 +24,7 @@ final demoSyncTables = <Table>[
Types.t,
Unique.t,
UniqueComposite.t,
UniqueDiscriminator.t,
UniqueSetNullChild.t,
UniqueUuid.t,
];

View file

@ -295,6 +295,7 @@ class DemoDebugEndpoint extends Endpoint {
await add<Unique>();
await add<UniqueUuid>();
await add<UniqueComposite>();
await add<UniqueDiscriminator>();
await add<UniqueSetNullChild>();
await add<Types>();
await add<FkChainRoot>();

View file

@ -0,0 +1,9 @@
class: UniqueDiscriminator
table: unique_discriminator
database: all
fields:
id: UuidValue?, defaultPersist=random_v7
### Owner scope of this row. Maintained by the CRDT sync layer.
scopeId: int?, relation(parent=crdt_scopes, onDelete=Cascade)
categoryId: int
name: String, unique(per=[scopeId, categoryId])

View file

@ -0,0 +1,8 @@
class: UniqueNoRelease
table: unique_no_release
database: all
fields:
id: UuidValue?, defaultPersist=random_v7
### Owner scope of this row. Maintained by the CRDT sync layer.
scopeId: int?, relation(parent=crdt_scopes, onDelete=Cascade)
categoryId: int, unique(per=[scopeId])