Skip to content

Commit

Permalink
Merge pull request juju#16678 from tlm/model-config-api
Browse files Browse the repository at this point in the history
juju#16678

Previously I added this table as it looked like we were going to need it for controller model wide defaults. This has since been revised and is no longer needed.

## Checklist

- [x] Code style: imports ordered, good names, simple structure, etc
- [x] Comments saying why design decisions were made
- ~[ ] Go unit tests, with comments saying what you're testing~
- ~[ ] [Integration tests](https://github.com/juju/juju/tree/main/tests), with comments saying what you're testing~
- ~[ ] [doc.go](https://discourse.charmhub.io/t/readme-in-packages/451) added or updated in changed packages~

## QA steps

None, code was not in use yet.

## Documentation changes

N/A

## Links

**Jira card:** JUJU-5061
  • Loading branch information
jujubot authored Dec 8, 2023
2 parents b784c5f + 0992eb2 commit d8418c7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
18 changes: 0 additions & 18 deletions domain/schema/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func ControllerDDL() *schema.Schema {
objectStoreMetadataSchema,
changeLogTriggersForTable("object_store_metadata_path", "path", tableObjectStoreMetadata),
userSchema,
modelConfigDefaults,
flagSchema,
}

Expand Down Expand Up @@ -583,23 +582,6 @@ CREATE TABLE user_activation_key (
);`)
}

// modelConfigDefaults is responsible for making a model config defaults table.
// The purpose of this table is to offer model defaults to all newly created
// models in Juju regardless of what cloud or cloud region the model is attached
// to.
//
// Previously Juju has been solving this problem by using the controller model
// config as this source of information. We want to stop special casing the
// controller's model and using it as a defaults source for other models.
func modelConfigDefaults() schema.Patch {
return schema.MakePatch(`
CREATE TABLE model_config_defaults (
key TEXT PRIMARY KEY,
value TEXT
)
`)
}

func flagSchema() schema.Patch {
return schema.MakePatch(`
CREATE TABLE flag (
Expand Down
3 changes: 0 additions & 3 deletions domain/schema/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ func (s *schemaSuite) TestControllerDDLApply(c *gc.C) {
"user_password",
"user_activation_key",

// Model Config Defaults
"model_config_defaults",

// Flags
"flag",
)
Expand Down

0 comments on commit d8418c7

Please sign in to comment.