feat(12.2-01): add deferred:purge, its daily framework schedule and relation child hooks
- deferred:purge [--days] in lagoon.RuntimeCommands (purge_days, default 5)
- lagoon.FrameworkSchedule entry at purge_at (default 03:00, empty disables)
- conga prepends framework entries as summercms.lagoon[i]:<command>
- pact.Relation{Before,After}{Create,Update,Delete} optional hooks
- lagoon, conga and pact READMEs, scheduling and setup docs
This commit is contained in:
@@ -391,6 +391,51 @@ type RelationBeforeLink interface {
|
||||
RelationBeforeLink(ctx context.Context, relation string, parent, related any, pivot map[string]any) error
|
||||
}
|
||||
|
||||
// The six relation child hooks below are optional admin-controller
|
||||
// capabilities for a relation manager that creates, updates or deletes
|
||||
// related records. Before hooks run inside the child write's transaction
|
||||
// before the row is written; After hooks run after the write and before the
|
||||
// commit. parent is the loaded parent record, or a fresh record with a zero
|
||||
// key while the parent is not saved yet (deferral). child is the related
|
||||
// record being written. An error rolls the write back and the admin API
|
||||
// answers its opaque lifecycle error.
|
||||
|
||||
// RelationBeforeCreate optionally runs before a related record is created
|
||||
// through a relation manager.
|
||||
type RelationBeforeCreate interface {
|
||||
RelationBeforeCreate(ctx context.Context, relation string, parent, child any) error
|
||||
}
|
||||
|
||||
// RelationAfterCreate optionally runs after a related record is created
|
||||
// through a relation manager, before the commit.
|
||||
type RelationAfterCreate interface {
|
||||
RelationAfterCreate(ctx context.Context, relation string, parent, child any) error
|
||||
}
|
||||
|
||||
// RelationBeforeUpdate optionally runs before a related record is updated
|
||||
// through a relation manager.
|
||||
type RelationBeforeUpdate interface {
|
||||
RelationBeforeUpdate(ctx context.Context, relation string, parent, child any) error
|
||||
}
|
||||
|
||||
// RelationAfterUpdate optionally runs after a related record is updated
|
||||
// through a relation manager, before the commit.
|
||||
type RelationAfterUpdate interface {
|
||||
RelationAfterUpdate(ctx context.Context, relation string, parent, child any) error
|
||||
}
|
||||
|
||||
// RelationBeforeDelete optionally runs before a related record is deleted
|
||||
// through a relation manager.
|
||||
type RelationBeforeDelete interface {
|
||||
RelationBeforeDelete(ctx context.Context, relation string, parent, child any) error
|
||||
}
|
||||
|
||||
// RelationAfterDelete optionally runs after a related record is deleted
|
||||
// through a relation manager, before the commit.
|
||||
type RelationAfterDelete interface {
|
||||
RelationAfterDelete(ctx context.Context, relation string, parent, child any) error
|
||||
}
|
||||
|
||||
// FilterScope is the model capability a config_filter scope name may call.
|
||||
// FilterScopes is the exact, case-sensitive set of names; request text never
|
||||
// selects a method outside that set.
|
||||
|
||||
Reference in New Issue
Block a user