{"action":"created","issue":{"url":"https://api.github.com/repos/ryannjohnson/django-schemas/issues/8","repository_url":"https://api.github.com/repos/ryannjohnson/django-schemas","labels_url":"https://api.github.com/repos/ryannjohnson/django-schemas/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/ryannjohnson/django-schemas/issues/8/comments","events_url":"https://api.github.com/repos/ryannjohnson/django-schemas/issues/8/events","html_url":"https://github.com/ryannjohnson/django-schemas/issues/8","id":155538996,"number":8,"title":"Getting blank SQL from migrations","user":{"login":"Algomorph","id":1050606,"avatar_url":"https://avatars.githubusercontent.com/u/1050606?v=3","gravatar_id":"","url":"https://api.github.com/users/Algomorph","html_url":"https://github.com/Algomorph","followers_url":"https://api.github.com/users/Algomorph/followers","following_url":"https://api.github.com/users/Algomorph/following{/other_user}","gists_url":"https://api.github.com/users/Algomorph/gists{/gist_id}","starred_url":"https://api.github.com/users/Algomorph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Algomorph/subscriptions","organizations_url":"https://api.github.com/users/Algomorph/orgs","repos_url":"https://api.github.com/users/Algomorph/repos","events_url":"https://api.github.com/users/Algomorph/events{/privacy}","received_events_url":"https://api.github.com/users/Algomorph/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2016-05-18T15:57:18Z","updated_at":"2016-06-01T15:47:33Z","closed_at":"2016-05-25T15:39:30Z","body":"No idea what's going on, but I'm getting blank SQL from migrations like this when using django_schemas:\r\n```SQL\r\nBEGIN;\r\n--\r\n-- Create model Proposal\r\n--\r\n\r\nCOMMIT;\r\n```\r\nHere is the code for the migration:\r\n```python\r\nclass Migration(migrations.Migration):\r\n\r\n    initial = True\r\n\r\n    dependencies = [\r\n    ]\r\n\r\n    operations = [\r\n        migrations.CreateModel(\r\n            name='Proposal',\r\n            fields=[\r\n                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),\r\n                ('title', models.CharField(max_length=200)),\r\n            ],\r\n            options={\r\n                'db_tablespace': 'data',\r\n                'db_table': 'proposal',\r\n                'db_environment': 'research2',\r\n            },\r\n            bases=(django_schemas.models.Model, models.Model),\r\n        ),\r\n    ]\r\n```\r\n\r\nHere is code for the model:\r\n```python\r\nfrom django.db import models\r\nfrom django_schemas.models import Model as SchemaModel\r\n\r\n\r\n# Create your models here.\r\nclass Proposal(SchemaModel, models.Model):\r\n    title = models.CharField(max_length=200)\r\n\r\n    class Meta:\r\n        db_tablespace = 'data'\r\n        db_table = 'proposal'\r\n        db_environment = 'research2'\r\n```\r\n\r\nHere is my settings.py file:\r\n```python\r\n\"\"\"\r\nDjango settings for vpr_webtools project.\r\n\r\nGenerated by 'django-admin startproject' using Django 1.9.5.\r\n\r\nFor more information on this file, see\r\nhttps://docs.djangoproject.com/en/1.9/topics/settings/\r\n\r\nFor the full list of settings and their values, see\r\nhttps://docs.djangoproject.com/en/1.9/ref/settings/\r\n\"\"\"\r\n\r\nimport os\r\n\r\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\r\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\r\n\r\n# Quick-start development settings - unsuitable for production\r\n# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/\r\n\r\n# SECURITY WARNING: keep the secret key used in production secret!\r\nSECRET_KEY = 'scrambled_for_display_purposes'\r\n\r\n# SECURITY WARNING: don't run with debug turned on in production!\r\nDEBUG = True\r\n\r\nALLOWED_HOSTS = []\r\n\r\n# Application definition\r\n\r\nINSTALLED_APPS = [\r\n    'django.contrib.admin',\r\n    'django.contrib.auth',\r\n    'django.contrib.contenttypes',\r\n    'django.contrib.sessions',\r\n    'django.contrib.messages',\r\n    'django.contrib.staticfiles',\r\n    'hello.apps.HelloConfig',\r\n    'faculty_reports.apps.FacultyReportsConfig',\r\n    'django_schemas'\r\n]\r\n\r\nMIDDLEWARE_CLASSES = [\r\n    'django.middleware.security.SecurityMiddleware',\r\n    'django.contrib.sessions.middleware.SessionMiddleware',\r\n    'django.middleware.common.CommonMiddleware',\r\n    'django.middleware.csrf.CsrfViewMiddleware',\r\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\r\n    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',\r\n    'django.contrib.messages.middleware.MessageMiddleware',\r\n    'django.middleware.clickjacking.XFrameOptionsMiddleware',\r\n]\r\n\r\nROOT_URLCONF = 'vpr_webtools.urls'\r\n\r\nTEMPLATES = [\r\n    {\r\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\r\n        'DIRS': [],\r\n        'APP_DIRS': True,\r\n        'OPTIONS': {\r\n            'context_processors': [\r\n                'django.template.context_processors.debug',\r\n                'django.template.context_processors.request',\r\n                'django.contrib.auth.context_processors.auth',\r\n                'django.contrib.messages.context_processors.messages',\r\n            ],\r\n        },\r\n    },\r\n]\r\n\r\nWSGI_APPLICATION = 'vpr_webtools.wsgi.application'\r\n\r\n# Database\r\n# https://docs.djangoproject.com/en/1.9/ref/settings/#databases\r\n\r\nDATABASES = {\r\n    'default': {\r\n        'ENGINE': 'django_schemas.backends.postgres.wrapper',\r\n        'NAME': 'vpr',\r\n        'USER': 'db_user',\r\n        'PASSWORD': 'concealed for display purposes',\r\n        'HOST': 'concealed ',\r\n        'PORT': 'concealed '',\r\n        'ENVIRONMENTS': [\r\n            'research',\r\n            'research2',\r\n            'contacts'\r\n        ]\r\n    }\r\n}\r\n\r\nDATABASE_ENVIRONMENTS = {\r\n    'research': {\r\n        'SCHEMA_NAME': 'research',\r\n        'ADDITIONAL_SCHEMAS': ['public']\r\n    },\r\n    'research2': {\r\n        'SCHEMA_NAME': 'research2',\r\n        'ADDITIONAL_SCHEMAS': ['public']\r\n    },\r\n    'contacts': {\r\n        'SCHEMA_NAME': 'contacts',\r\n        'ADDITIONAL_SCHEMAS': ['public']\r\n    },\r\n}\r\n\r\nDATABASE_ROUTERS = [\r\n    'django_schemas.routers.ExplicitRouter',\r\n]\r\n\r\n# Password validation\r\n# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators\r\n\r\nAUTH_PASSWORD_VALIDATORS = [\r\n    {\r\n        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',\r\n    },\r\n    {\r\n        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',\r\n    },\r\n    {\r\n        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',\r\n    },\r\n    {\r\n        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',\r\n    },\r\n]\r\n\r\n# Internationalization\r\n# https://docs.djangoproject.com/en/1.9/topics/i18n/\r\n\r\nLANGUAGE_CODE = 'en-us'\r\n\r\nTIME_ZONE = 'UTC'\r\n\r\nUSE_I18N = True\r\n\r\nUSE_L10N = True\r\n\r\nUSE_TZ = True\r\n\r\n# Static files (CSS, JavaScript, Images)\r\n# https://docs.djangoproject.com/en/1.9/howto/static-files/\r\n\r\nSTATIC_URL = '/static/'\r\n\r\n```\r\n\r\nWhen I comment-out the DATABASE_ROUTERS, I get a normal SQL file, but that doesn't contain the proper schema.\r\nI'm on Python 3.5, Django 1.9, and Postgres 9.4.\r\nAny idea what I'm doing wrong or how to fix it?"},"comment":{"url":"https://api.github.com/repos/ryannjohnson/django-schemas/issues/comments/223036091","html_url":"https://github.com/ryannjohnson/django-schemas/issues/8#issuecomment-223036091","issue_url":"https://api.github.com/repos/ryannjohnson/django-schemas/issues/8","id":223036091,"user":{"login":"ryannjohnson","id":11235486,"avatar_url":"https://avatars.githubusercontent.com/u/11235486?v=3","gravatar_id":"","url":"https://api.github.com/users/ryannjohnson","html_url":"https://github.com/ryannjohnson","followers_url":"https://api.github.com/users/ryannjohnson/followers","following_url":"https://api.github.com/users/ryannjohnson/following{/other_user}","gists_url":"https://api.github.com/users/ryannjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/ryannjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryannjohnson/subscriptions","organizations_url":"https://api.github.com/users/ryannjohnson/orgs","repos_url":"https://api.github.com/users/ryannjohnson/repos","events_url":"https://api.github.com/users/ryannjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/ryannjohnson/received_events","type":"User","site_admin":false},"created_at":"2016-06-01T15:47:32Z","updated_at":"2016-06-01T15:47:32Z","body":"@Algomorph Not sure - it just worked for me. Here's the project I used to test it with: http://ryannjohnson.com/downloads/2016-06-01-01_myproject.tar.bz2. I only ran `migrate`. "}}
{"actor":{"display_login":"ryannjohnson"}}