Skip to content

Commit

Permalink
Add model triggers for the objectstore
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonRichardson committed Nov 28, 2023
1 parent f512f16 commit ec2381f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion domain/objectstore/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import (
"context"
"fmt"

"github.com/juju/utils/v3"

"github.com/juju/juju/core/changestream"
coreobjectstore "github.com/juju/juju/core/objectstore"
"github.com/juju/juju/core/watcher"
"github.com/juju/juju/domain"
"github.com/juju/juju/domain/objectstore"
"github.com/juju/utils/v3"
)

// State describes retrieval and persistence methods for the coreobjectstore.
Expand Down
5 changes: 4 additions & 1 deletion domain/schema/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

const (
tableModelConfig tableNamespaceID = iota + 1
tableModelObjectStoreMetadata
)

// ModelDDL is used to create model databases.
Expand All @@ -19,6 +20,7 @@ func ModelDDL() *schema.Schema {
modelConfig,
changeLogTriggersForTable("model_config", "key", tableModelConfig),
objectStoreMetadataSchema,
changeLogTriggersForTable("object_store_metadata_path", "path", tableModelObjectStoreMetadata),
applicationSchema,
nodeSchema,
unitSchema,
Expand All @@ -38,7 +40,8 @@ func changeLogModelNamespace() schema.Patch {
// constants above.
return schema.MakePatch(`
INSERT INTO change_log_namespace VALUES
(1, 'model_config', 'model config changes based on config key')
(1, 'model_config', 'model config changes based on config key'),
(2, 'object_store_metadata_path', 'object store metadata path changes based on the path')
`)
}

Expand Down

0 comments on commit ec2381f

Please sign in to comment.