Migration to remove/add the feature

pr/4577
Manuel Kaufmann 2018-08-22 11:25:45 -03:00
parent eb4faa43ee
commit 8c33590e61
1 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-08-22 09:19
from __future__ import unicode_literals
from django.db import migrations
FEATURE_ID = 'build_json_artifacts_with_html'
def forward_add_feature(apps, schema_editor):
Feature = apps.get_model('projects', 'Feature')
try:
Feature.objects.get(feature_id=FEATURE_ID).delete()
except Feature.DoesNotExist:
pass
def reverse_add_feature(apps, schema_editor):
Feature = apps.get_model('projects', 'Feature')
Feature.objects.create(feature_id=FEATURE_ID)
class Migration(migrations.Migration):
dependencies = [
('projects', '0026_ad-free-option'),
]
operations = [
migrations.RunPython(forward_add_feature, reverse_add_feature),
]