forked from project-koku/koku
-
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.
Cost 1329 initial enabled keys migration (project-koku#3716)
* Migration to add 'enabled' column * initial migration * fix sql * update PR template
- Loading branch information
Showing
5 changed files
with
104 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
Fixes [COST-####](https://issues.redhat.com/browse/COST-####) | ||
## Jira Ticket | ||
|
||
Changes proposed in this PR: | ||
* | ||
* | ||
[COST-####](https://issues.redhat.com/browse/COST-####) | ||
|
||
Testing Instructions: | ||
1. Run `this command` ... | ||
2. Ingest this data `with this other command` ... | ||
3. Expect to see this result: | ||
``` | ||
GET http://localhost:8000/api/endpoint | ||
## Description | ||
|
||
{json: response} | ||
``` | ||
4. | ||
5. | ||
This change will ... | ||
|
||
--- | ||
Additional Context: | ||
## Testing | ||
|
||
1. Checkout Branch | ||
2. Restart Koku | ||
3. Hit endpoint or launch shell | ||
1. You should see ... | ||
4. Do more things... | ||
|
||
## Notes | ||
|
||
... |
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,83 @@ | ||
# Generated by Django 3.2.13 on 2022-06-17 19:32 | ||
from django.db import migrations | ||
from django.db import models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [("reporting", "0255_ocp_label_indices")] | ||
|
||
operations = [ | ||
migrations.RunSQL( | ||
sql=""" | ||
alter table reporting_azureenabledtagkeys | ||
add column enabled boolean not null default true; | ||
create index azure_enabled_covering_ix | ||
on reporting_azureenabledtagkeys (key, enabled); | ||
""", | ||
reverse_sql=""" | ||
drop index azure_enabled_covering_ix; | ||
alter table reporting_azureenabledtagkeys | ||
drop column enabled; | ||
""", | ||
state_operations=[ | ||
migrations.AddField( | ||
model_name="azureenabledtagkeys", | ||
name="enabled", | ||
field=models.BooleanField(default=True), | ||
), | ||
migrations.AddIndex( | ||
model_name="azureenabledtagkeys", | ||
index=models.Index(fields=["key", "enabled"], name="azure_enabled_covering_ix"), | ||
), | ||
], | ||
), | ||
migrations.RunSQL( | ||
sql=""" | ||
alter table reporting_gcpenabledtagkeys | ||
add column enabled boolean not null default true; | ||
create index gcp_enabled_covering_ix | ||
on reporting_gcpenabledtagkeys (key, enabled); | ||
""", | ||
reverse_sql=""" | ||
drop index gcp_enabled_covering_ix; | ||
alter table reporting_gcpenabledtagkeys | ||
drop column enabled; | ||
""", | ||
state_operations=[ | ||
migrations.AddField( | ||
model_name="gcpenabledtagkeys", | ||
name="enabled", | ||
field=models.BooleanField(default=True), | ||
), | ||
migrations.AddIndex( | ||
model_name="gcpenabledtagkeys", | ||
index=models.Index(fields=["key", "enabled"], name="gcp_enabled_covering_ix"), | ||
), | ||
], | ||
), | ||
migrations.RunSQL( | ||
sql=""" | ||
alter table reporting_ocpenabledtagkeys | ||
add column enabled boolean not null default true; | ||
create index ocp_enabled_covering_ix | ||
on reporting_ocpenabledtagkeys (key, enabled); | ||
""", | ||
reverse_sql=""" | ||
drop index ocp_enabled_covering_ix; | ||
alter table reporting_ocpenabledtagkeys | ||
drop column enabled; | ||
""", | ||
state_operations=[ | ||
migrations.AddField( | ||
model_name="ocpenabledtagkeys", | ||
name="enabled", | ||
field=models.BooleanField(default=True), | ||
), | ||
migrations.AddIndex( | ||
model_name="ocpenabledtagkeys", | ||
index=models.Index(fields=["key", "enabled"], name="ocp_enabled_covering_ix"), | ||
), | ||
], | ||
), | ||
] |
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