-
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#17039 from wallyworld/storage_constraint-ddl
juju#17039 Here we rework the storage constraints DDL to reflect the implementation requirements. The storage constraints are tied to an application or unit, not storage instance. The attributes are known, fixed, and fully populated for each constraint so we can model using a single table, one row per constraint. Storage constraints are modelled similar to cloud or model config key values. The possible storage names come from the charm metadata; each application/unit has a tuple (pool, size, count) for each named storage. Thus the primary key of the app/unit storage constraint table is (parent uuid, storage name). The remaining columns are the constraint attributes (pool, size, count). Charm storage tables are added to provide a parent record for the FK from the storage constraints table. We store storage pool as a text value rather than a FK to the storage pool table because it can either be a pool OR a storage type (eg loop or ebs or tmps). The type can be a built in type or a provider specific type. Hence for the same reason we model storage pool type as a text value, we do so here too. In line with the above, the storage_instance_pool table is removed and a text storage_pool attribute in the storage instance table is used instead. ## QA steps Unit tests **Jira card:** JUJU-5672
- Loading branch information
Showing
4 changed files
with
119 additions
and
49 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
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