-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
154 additions
and
96 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
wagtail_ab_testing/migrations/0010_rename_treatment_to_variant.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,28 @@ | ||
# Generated by Django 3.1.3 on 2020-12-16 13:40 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('wagtail_ab_testing', '0009_rename_variant_to_version'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='abtest', | ||
old_name='treatment_revision', | ||
new_name='variant_revision', | ||
), | ||
migrations.AlterField( | ||
model_name='abtest', | ||
name='winning_version', | ||
field=models.CharField(choices=[('control', 'Control'), ('variant', 'Variant')], max_length=9, null=True), | ||
), | ||
migrations.AlterField( | ||
model_name='abtesthourlylog', | ||
name='version', | ||
field=models.CharField(choices=[('control', 'Control'), ('variant', 'Variant')], max_length=9), | ||
), | ||
] |
30 changes: 30 additions & 0 deletions
30
wagtail_ab_testing/migrations/0011_rename_treatment_to_variant_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,30 @@ | ||
# Generated by Django 3.1.3 on 2020-12-16 13:40 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
def rename_treatment_to_variant_forwards(apps, schema_editor): | ||
AbTest = apps.get_model('wagtail_ab_testing.AbTest') | ||
AbTest.objects.filter(winning_version='treatment').update(winning_version='variant') | ||
|
||
AbTestHourlyLog = apps.get_model('wagtail_ab_testing.AbTestHourlyLog') | ||
AbTestHourlyLog.objects.filter(version='treatment').update(version='variant') | ||
|
||
|
||
def rename_treatment_to_variant_backwards(apps, schema_editor): | ||
AbTest = apps.get_model('wagtail_ab_testing.AbTest') | ||
AbTest.objects.filter(winning_version='variant').update(winning_version='treatment') | ||
|
||
AbTestHourlyLog = apps.get_model('wagtail_ab_testing.AbTestHourlyLog') | ||
AbTestHourlyLog.objects.filter(version='variant').update(version='treatment') | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('wagtail_ab_testing', '0010_rename_treatment_to_variant'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(rename_treatment_to_variant_forwards, rename_treatment_to_variant_backwards) | ||
] |
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.