feat(12.2-01): add deferred bindings, guarded upload store and purge
- deferred_bindings migration set under summercms.deferred with backend_user_id - lagoon.DeferredBind/Unbind/Bindings/Forget/Slaves scoped by DeferredKey - lagoon.PurgeDeferred with SKIP LOCKED batches and after-commit blob deletes - attach.Store with the ported image guard, extension and MIME limits - attach.Relation, attach.HasRelations, attach.BlobKeys, File.ThumbKey - lagoon README and attachments docs
This commit is contained in:
@@ -57,9 +57,10 @@ func migrator(gdb *gorm.DB, pluginID string, migrations []*gormigrate.Migration)
|
||||
}, migrations), nil
|
||||
}
|
||||
|
||||
// Migrate runs the framework-owned system_files, backend-admin and job-queue
|
||||
// (QueueMigrations) sets first, then each plugin's HasMigrations set in
|
||||
// party.Activate order.
|
||||
// Migrate runs the framework-owned system_files, backend-admin,
|
||||
// deferred-binding (DeferredBindingMigrations, history DeferredHistoryID) and
|
||||
// job-queue (QueueMigrations) sets first, then each plugin's HasMigrations set
|
||||
// in party.Activate order.
|
||||
func Migrate(gdb *gorm.DB, plugins []party.Plugin) error {
|
||||
if gdb == nil {
|
||||
return fmt.Errorf("lagoon: gorm db is nil")
|
||||
@@ -78,6 +79,13 @@ func Migrate(gdb *gorm.DB, plugins []party.Plugin) error {
|
||||
if err := admin.Migrate(); err != nil {
|
||||
return fmt.Errorf("lagoon: migrate backend admin: %w", err)
|
||||
}
|
||||
deferred, err := migrator(gdb, DeferredHistoryID, DeferredBindingMigrations)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deferred.Migrate(); err != nil {
|
||||
return fmt.Errorf("lagoon: migrate deferred bindings: %w", err)
|
||||
}
|
||||
sqlDB, err := gdb.DB()
|
||||
if err != nil {
|
||||
return fmt.Errorf("lagoon: migrate queue: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user