-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1: ongoing changes to update contents of Dataset.parameters field
- Loading branch information
Showing
4 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
geospaas/catalog/migrations/0008a_add_newparameters_field.py
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,19 @@ | ||
# Generated by Django 2.1.5 on 2019-02-04 18:01 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('vocabularies', '0001_initial'), | ||
('catalog', '0007c_remove_source_and_specs_fields'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='dataset', | ||
name='newparameters', | ||
field=models.ManyToManyField(to='vocabularies.Parameter'), | ||
), | ||
] |
19 changes: 19 additions & 0 deletions
19
geospaas/catalog/migrations/0008b_migrate_parameters_data.py
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,19 @@ | ||
# Generated by Django 2.1.5 on 2019-02-05 12:18 | ||
|
||
from django.db import migrations | ||
|
||
def forward(apps, schema_editor): | ||
Dataset = apps.get_model('catalog', 'Dataset') | ||
for ds in Dataset.objects.all(): | ||
ds.newparameters.add(ds.parameters.parameter) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('catalog', '0008a_add_newparameters_field'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forward, backward), | ||
] |
File renamed without changes.
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