-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Allow use of native migrations in 1.7 #1653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…erent route types
…een different route types
…ute, marked the originals as deprecated.
Fixed code example.
Conflicts: .travis.yml rest_framework/serializers.py rest_framework/tests/test_authentication.py
Conflicts: tests/test_serializer.py
Conflicts: rest_framework/runtests/urls.py tests/test_response.py tox.ini
Conflicts: .travis.yml docs/api-guide/viewsets.md rest_framework/serializers.py rest_framework/throttling.py tests/test_generics.py tests/test_serializers.py tox.ini
|
||
# 1.7 Migration Compatibility | ||
|
||
'SOUTH_MIGRATION_MODULES': { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work here. Needs to be in actual settings. That needs to be added to the docs.
@carltongibson thanks for the PR and the tests. |
OK — I'll draft the changes there. (Do we have Work In Progress release notes anywhere?) |
Release notes are part of the repository (docs/topics/release-notes.md). We'll add items above the 2.3.14 release. |
Fine. I'll put the notes there. Thanks |
…IGRATION_MODULES` setting from `rest_framework.settings`
This tells South to look in the `south_migrations` module for the `authtoken` app. | ||
|
||
---- | ||
|
||
|
||
If you're using a [custom user model][custom-user-model] you'll need to make sure that any initial migration that creates the user table runs before the authtoken table is created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without thinking about it, I'm not sure what needs to be said in this section.
Topics are:
- Migration dependencies. (Not sure, yet, how Django handles that)
post_save
creation of tokens — I'd guess this remains unchanged but need to think it through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grumble, grumble... :) Django uses depenencies
rather than needed_by
but looks okay other than that.
https://docs.djangoproject.com/en/1.7/topics/migrations/#migration-files
I'll edit later on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will change anything for those two points. We are just using an alternative location for south's modules.
However I don't know the minimum south version that will support that configuration option.
…into encode#1559 Conflicts: docs/topics/release-notes.md
@xordoquy — OK, I've done something wrong... I merged the 2.4.0 branch into my #1559 — https://github.com/carltongibson/django-rest-framework/tree/%231559 — but when I go to compare against 2.4.0 GitHub "can't find anything to compare". As far as I can see my branch is a straight 3 commits ahead of 2.4.0 so I'm not sure what I've done. Could you review? Thanks! |
@carltongibson will do that after meal. |
Cool. Thanks. On 24 Jun 2014, at 10:50, Xavier Ordoquy notifications@github.com wrote:
|
First pass at #1559.
South provides a SOUTH_MIGRATION_MODULES setting. We use this to move the existing migrations to one side.
1.7's
makemigrations
is responsible for the new migration.Adding the South setting to
rest_framework.setttings
doesn't work — and (of course) there's no reason that it should.But manually adding it to your own settings.py does work. The following works:
I need to back out the change to
rest_framework.setttings
and document (where?) the change and (at first glance) it looks good.Thoughts?