3
0

Prevent connection change for existing modules

This commit is contained in:
Tomaž Jerman
2022-06-14 20:21:32 +02:00
parent 71b3aacae5
commit cfed35d639

View File

@@ -425,6 +425,10 @@ func (svc module) updater(ctx context.Context, namespaceID, moduleID uint64, act
}
if changes&moduleChanged > 0 {
if old.ModelConfig.ConnectionID != m.ModelConfig.ConnectionID {
return fmt.Errorf("unable to switch connection for existing models: run data migration")
}
if err = store.UpdateComposeModule(ctx, svc.store, m); err != nil {
return err
}