feat: Implements foreign key handling (#68)

This commit is contained in:
Marcelo Mendonça Soares 2026-06-10 17:31:05 -03:00 • committed by GitHub
commit 4580326956
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 6630 additions and 189 deletions

View file

@ -0,0 +1,8 @@
class: FkChainCascadeMiddle
table: fk_chain_cascade_middle
database: all
fields:
id: UuidValue?, defaultPersist=random_v7
name: String
root: FkChainRoot?, relation(field=rootId, onDelete=Cascade)
rootId: UuidValue?

View file

@ -0,0 +1,8 @@
class: FkChainMiddleCascadeChild
table: fk_chain_middle_cascade_child
database: all
fields:
id: UuidValue?, defaultPersist=random_v7
name: String
restrictBlocker: FkChainRestrictBlocker?, relation(field=restrictBlockerId, onDelete=Cascade)
restrictBlockerId: UuidValue?

View file

@ -0,0 +1,8 @@
class: FkChainMiddleSetNullChild
table: fk_chain_middle_set_null_child
database: all
fields:
id: UuidValue?, defaultPersist=random_v7
name: String
restrictBlocker: FkChainRestrictBlocker?, relation(field=restrictBlockerId, onDelete=SetNull)
restrictBlockerId: UuidValue?

View file

@ -0,0 +1,8 @@
class: FkChainRestrictBlocker
table: fk_chain_restrict_blocker
database: all
fields:
id: UuidValue?, defaultPersist=random_v7
name: String
cascadeMiddle: FkChainCascadeMiddle?, relation(field=cascadeMiddleId, onDelete=Restrict)
cascadeMiddleId: UuidValue?

View file

@ -0,0 +1,6 @@
class: FkChainRoot
table: fk_chain_root
database: all
fields:
id: UuidValue?, defaultPersist=random_v7
name: String

View file

@ -0,0 +1,8 @@
class: FkChainSetNullCascadeChild
table: fk_chain_set_null_cascade_child
database: all
fields:
id: UuidValue?, defaultPersist=random_v7
name: String
setNullMiddle: FkChainSetNullMiddle?, relation(field=setNullMiddleId, onDelete=Cascade)
setNullMiddleId: UuidValue?

View file

@ -0,0 +1,8 @@
class: FkChainSetNullMiddle
table: fk_chain_set_null_middle
database: all
fields:
id: UuidValue?, defaultPersist=random_v7
name: String
cascadeMiddle: FkChainCascadeMiddle?, relation(field=cascadeMiddleId, onDelete=SetNull)
cascadeMiddleId: UuidValue?

View file

@ -0,0 +1,8 @@
class: FkChainSetNullRestrictChild
table: fk_chain_set_null_restrict_child
database: all
fields:
id: UuidValue?, defaultPersist=random_v7
name: String
setNullMiddle: FkChainSetNullMiddle?, relation(field=setNullMiddleId, onDelete=Restrict)
setNullMiddleId: UuidValue?

View file

@ -0,0 +1,8 @@
class: FkChainSetNullSetNullChild
table: fk_chain_set_null_set_null_child
database: all
fields:
id: UuidValue?, defaultPersist=random_v7
name: String
setNullMiddle: FkChainSetNullMiddle?, relation(field=setNullMiddleId, onDelete=SetNull)
setNullMiddleId: UuidValue?

View file

@ -0,0 +1,8 @@
class: RequiredSetNullChild
table: required_set_null_child
database: all
fields:
id: UuidValue?, defaultPersist=random_v7
name: String
parent: Person?, relation(field=parentId, onDelete=SetNull)
parentId: UuidValue

View file

@ -0,0 +1,8 @@
class: RestrictChild
table: restrict_child
database: all
fields:
id: UuidValue?, defaultPersist=random_v7
name: String
parent: Person?, relation(field=parentId, onDelete=Restrict)
parentId: UuidValue?

View file

@ -4,4 +4,5 @@ database: all
fields:
id: UuidValue?, defaultPersist=random_v7
name: String
city: City?, relation(optional, onDelete=Cascade)
mayor: Person?, relation(optional, onDelete=SetNull)

View file

@ -0,0 +1,8 @@
class: UniqueSetNullChild
table: unique_set_null_child
database: all
fields:
id: UuidValue?, defaultPersist=random_v7
name: String
parent: Person?, relation(field=parentId, onDelete=SetNull)
parentId: UuidValue?, unique