-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request juju#17043 from SimonRichardson/model-table-schema
juju#17043 This creates a model table schema for model databases. The model table will be a read-only table. You can't update it or create a new entry in the table, only one row can exist at the same time. The table is a denormalized view of the model_metadata table in the controller database. It is not expected to use this table for foreign keys as the data is not linked via UUIDs, this is cached data from the controller database. Triggers and constraints are used to ensure that we only allow one row at a time and no modifications can be met. Deletion is currently ignored, but that can also be fixed with a deletion trigger, making it truly read-only (that's a step too far IMO). I've wired up bootstrap and model migration, with model creation via the model manager left. That will require some thought on how that's possible. ## Checklist <!-- If an item is not applicable, use `~strikethrough~`. --> - [x] Code style: imports ordered, good names, simple structure, etc - [x] Comments saying why design decisions were made - [x] Go unit tests, with comments saying what you're testing ## QA steps ```sh $ juju bootstrap lxd test $ juju add-model default ``` ## Links **Jira card:** JUJU-5643
- Loading branch information
Showing
22 changed files
with
798 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2024 Canonical Ltd. | ||
// Licensed under the AGPLv3, see LICENCE file for details. | ||
|
||
package testing | ||
|
||
import "github.com/juju/juju/core/modelmigration" | ||
|
||
// IgnoredSetupOperation is a helper function to test the operation within a | ||
// coordinator. | ||
// This just ignores the setup call of the coordinator. It is expected that | ||
// the operation will have all the information up front. | ||
func IgnoredSetupOperation(op modelmigration.Operation) modelmigration.Operation { | ||
return &ignoredSetupOperation{Operation: op} | ||
} | ||
|
||
type ignoredSetupOperation struct { | ||
modelmigration.Operation | ||
} | ||
|
||
func (i *ignoredSetupOperation) Setup(modelmigration.Scope) error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.