Migration to remove/add the feature
parent
eb4faa43ee
commit
8c33590e61
|
@ -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),
|
||||
]
|
Loading…
Reference in New Issue