{"action":"created","issue":{"url":"https://api.github.com/repos/etianen/django-watson/issues/79","labels_url":"https://api.github.com/repos/etianen/django-watson/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/etianen/django-watson/issues/79/comments","events_url":"https://api.github.com/repos/etianen/django-watson/issues/79/events","html_url":"https://github.com/etianen/django-watson/issues/79","id":50310773,"number":79,"title":"Django 1.7 does not recognize data migrations properly","user":{"login":"JirkaV","id":45586,"avatar_url":"https://avatars.githubusercontent.com/u/45586?v=3","gravatar_id":"","url":"https://api.github.com/users/JirkaV","html_url":"https://github.com/JirkaV","followers_url":"https://api.github.com/users/JirkaV/followers","following_url":"https://api.github.com/users/JirkaV/following{/other_user}","gists_url":"https://api.github.com/users/JirkaV/gists{/gist_id}","starred_url":"https://api.github.com/users/JirkaV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JirkaV/subscriptions","organizations_url":"https://api.github.com/users/JirkaV/orgs","repos_url":"https://api.github.com/users/JirkaV/repos","events_url":"https://api.github.com/users/JirkaV/events{/privacy}","received_events_url":"https://api.github.com/users/JirkaV/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2014-11-27T17:05:36Z","updated_at":"2015-02-25T17:36:36Z","closed_at":null,"body":"First, a warning - this may be related to my setup only. But sharing it anyway since it might affect someone else too.\r\n\r\nMy webapp uses django-nose for testing. As I was moving it to Django 1.7, I noticed that several of my tests were failing with error similar to this:\r\n```\r\n    return self.cursor.execute(sql, params)\r\nProgrammingError: column watson_searchentry.search_tsv does not exist\r\nLINE 1: SELECT (ts_rank_cd(watson_searchentry.search_tsv, to_tsquery...\r\n```\r\n\r\nA bit of digging revealed that migrations for watson were not running properly. Django 1.7.1 was claiming that watson was an \"unmigrated app\" as it had old style  \"South\" migrations which were not being applied during my test run.\r\n\r\nI did try to convert them to new format following Django migrations tutorial, but the migration involving \"installwatson\" was ignored.\r\n\r\nI ended up resolving it by creating a new data migration for watson (using \"python manage.py makemigration --empty watson\" and updating the migration file so it looks like this:\r\n```\r\n# -*- coding: utf-8 -*-\r\nfrom __future__ import unicode_literals\r\n\r\nfrom django.db import models, migrations\r\nfrom django.core.management import call_command\r\nfrom watson.registration import get_backend\r\n\r\n\r\ndef install_watson(apps, schema_editor):\r\n    '''watson needs to be installed in the environment once DB is recreated\r\n    (e.g. during tests). Django 1.7 didn't pick it up during conversion\r\n    from south migrations to this is a workaround\r\n    '''\r\n    ## call_command(\"installwatson\", verbosity=0)\r\n\r\n    # the command above has problem with @atomic decorator, so we do it\r\n    # manually\r\n\r\n\r\n    backend = get_backend()\r\n    if backend.requires_installation:\r\n        backend.do_install()\r\n\r\n\r\nclass Migration(migrations.Migration):\r\n\r\n    dependencies = [\r\n        ('watson', '0001_initial'),\r\n    ]\r\n\r\n    operations = [\r\n        migrations.RunPython(install_watson),\r\n    ]\r\n```\r\n\r\nSharing it here just in case someone else runs into the same issue."},"comment":{"url":"https://api.github.com/repos/etianen/django-watson/issues/comments/76013467","html_url":"https://github.com/etianen/django-watson/issues/79#issuecomment-76013467","issue_url":"https://api.github.com/repos/etianen/django-watson/issues/79","id":76013467,"user":{"login":"codingjoe","id":1772890,"avatar_url":"https://avatars.githubusercontent.com/u/1772890?v=3","gravatar_id":"","url":"https://api.github.com/users/codingjoe","html_url":"https://github.com/codingjoe","followers_url":"https://api.github.com/users/codingjoe/followers","following_url":"https://api.github.com/users/codingjoe/following{/other_user}","gists_url":"https://api.github.com/users/codingjoe/gists{/gist_id}","starred_url":"https://api.github.com/users/codingjoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codingjoe/subscriptions","organizations_url":"https://api.github.com/users/codingjoe/orgs","repos_url":"https://api.github.com/users/codingjoe/repos","events_url":"https://api.github.com/users/codingjoe/events{/privacy}","received_events_url":"https://api.github.com/users/codingjoe/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T17:36:36Z","updated_at":"2015-02-25T17:36:36Z","body":"@iqbalhusen why would you create a migration for yourself in a different app?\r\nBut regarding your question, it might do that, because the initial migration is in fact a \"datamigration\".\r\nIt just calls the management commands `installwatson` and `uninstallwatson`.\r\ni don't know why it would recreate a migration tho, this smells like a django bug. You should investigate and report. There were a couple of bugs in v1.7 migrations.\r\nYou might also want to retry with the current django master, your problem might already be fixed."}}