-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
c3b4a30
commit b2524d7
Showing
3 changed files
with
62 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 3.0.3 on 2020-03-24 03:29 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('mdi', '0037_auto_20200323_0409'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='organization', | ||
name='categories', | ||
field=models.ManyToManyField(blank=True, null=True, to='mdi.Category'), | ||
), | ||
migrations.AlterField( | ||
model_name='organization', | ||
name='category', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='category_orig', to='mdi.Category'), | ||
), | ||
] |
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,21 @@ | ||
# Generated by Django 3.0.3 on 2020-03-24 03:31 | ||
|
||
from django.db import models, migrations | ||
|
||
|
||
def forward(apps, schema_editor): | ||
Organization = apps.get_model("mdi", "Organization") | ||
for organization in Organization.objects.all(): | ||
if organization.category is not None: | ||
organization.categories.add(organization.category) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('mdi', '0038_auto_20200324_0329'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forward) | ||
] |
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,17 @@ | ||
# Generated by Django 3.0.3 on 2020-03-24 03:51 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('mdi', '0039_auto_20200324_0331'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='organization', | ||
name='category', | ||
), | ||
] |