From 85f73af7958939a208ce15d3f52937e1a65f3856 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 31 Mar 2016 16:04:43 +0200 Subject: migrations for database nop should only be done on nop database diff --git a/nop/dbrouter.py b/nop/dbrouter.py new file mode 100644 index 0000000..fd8aaad --- /dev/null +++ b/nop/dbrouter.py @@ -0,0 +1,5 @@ +class NopRouter(object): + def allow_migrate(self, db, app_label, model_name=None, **hints): + if app_label == 'nop': + return db == 'nop' + return None diff --git a/nop/migrations/0001_initial.py b/nop/migrations/0001_initial.py index 200241b..67a04e8 100644 --- a/nop/migrations/0001_initial.py +++ b/nop/migrations/0001_initial.py @@ -6,6 +6,8 @@ from django.db import migrations, models class Migration(migrations.Migration): + app_label = 'nop' + dependencies = [ ] diff --git a/pv/settings.py b/pv/settings.py index 5d23ab9..e967b39 100644 --- a/pv/settings.py +++ b/pv/settings.py @@ -21,6 +21,8 @@ DATABASES = { } } +DATABASE_ROUTERS = ['nop.dbrouter.NopRouter'] + TIME_ZONE = 'Europe/Vienna' LANGUAGE_CODE = 'de' -- cgit v0.10.2