From e4ad4be16a1b41f9f43a33f60d776373a9332488 Mon Sep 17 00:00:00 2001 From: Zambom Date: Tue, 10 Jan 2017 19:17:12 -0200 Subject: [PATCH] Initial data for security and themes --- security/migrations/0002_auto_20170110_1807.py | 35 +++++++++++++++++++++++++++++++++++ themes/migrations/0002_auto_20170110_1809.py | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 0 deletions(-) create mode 100644 security/migrations/0002_auto_20170110_1807.py create mode 100644 themes/migrations/0002_auto_20170110_1809.py diff --git a/security/migrations/0002_auto_20170110_1807.py b/security/migrations/0002_auto_20170110_1807.py new file mode 100644 index 0000000..b4acf6d --- /dev/null +++ b/security/migrations/0002_auto_20170110_1807.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10 on 2017-01-10 21:07 +from __future__ import unicode_literals + +from django.db import migrations + +def forwards_func(apps, schema_editor): + # We get the model from the versioned app registry; + # if we directly import it, it'll be the wrong version + Security = apps.get_model("security", "Security") + + db_alias = schema_editor.connection.alias + + Security.objects.using(db_alias).bulk_create([ + Security(allow_register = False, maintence = False), + ]) + +def reverse_func(apps, schema_editor): + # forwards_func() creates two Country instances, + # so reverse_func() should delete them. + Security = apps.get_model("security", "Security") + + db_alias = schema_editor.connection.alias + + Security.objects.using(db_alias).filter(allow_register = False, maintence = False).delete() + +class Migration(migrations.Migration): + + dependencies = [ + ('security', '0001_initial'), + ] + + operations = [ + migrations.RunPython(forwards_func, reverse_func), + ] diff --git a/themes/migrations/0002_auto_20170110_1809.py b/themes/migrations/0002_auto_20170110_1809.py new file mode 100644 index 0000000..76100b6 --- /dev/null +++ b/themes/migrations/0002_auto_20170110_1809.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10 on 2017-01-10 21:09 +from __future__ import unicode_literals + +from django.db import migrations + +def forwards_func(apps, schema_editor): + # We get the model from the versioned app registry; + # if we directly import it, it'll be the wrong version + Themes = apps.get_model("themes", "Themes") + + db_alias = schema_editor.connection.alias + + Themes.objects.using(db_alias).bulk_create([ + Themes(title = 'Projeto Amadeus'), + ]) + +def reverse_func(apps, schema_editor): + # forwards_func() creates two Country instances, + # so reverse_func() should delete them. + Themes = apps.get_model("themes", "Themes") + + db_alias = schema_editor.connection.alias + + Themes.objects.using(db_alias).filter(title = 'Projeto Amadeus').delete() + +class Migration(migrations.Migration): + + dependencies = [ + ('themes', '0001_initial'), + ] + + operations = [ + migrations.RunPython(forwards_func, reverse_func), + ] -- libgit2 0.21.2