-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
docs: for sql db migration to 1.1 recommend --fake-initial #2425
Conversation
1eef2da
to
6b0c9ae
Compare
@ploxiln : will it work for all Django versions? Even if we upgrading from Graphite 0.9.x and/or Django 1.4 ? |
(Now |
@ploxiln : maybe that should be mentioned in docs too? Could you please amend it? Thanks! |
possibly worth mentioning: |
looks like, in django 1.8 and earlier, the behavior of
|
OK, I'll try adding a bit more to the docs about this |
I'm wondering all the time if we could automate this stuff on app startup? Just like Grafana does. |
Let me know how that looks/sounds. I'll squash commits before merge. |
... and --run-syncdb should no longer be needed. Initial migrations were created for all models just before 1.1.0 in d1912d4. Prior to that, some models did not have any migrations (and no initial migration), so --run-syncdb was needed to create tables for them. But now that they have initial migrations, those migrations run because django knows they have never been applied, and they fail because the tables already exist. The --fake-initial option is designed for this situation: it considers initial migrations already done if the tables already exist.
99594f5
to
e32a4ca
Compare
For me, it looks great. Maybe I could ask @gwaldo to check? |
Good idea - I think I figured this out, but I'm no django expert :) |
Is there any harm in always recommending users specify |
I don't think there would be any harm in always using It should be needed at most once, when migrating from < 1.1 to >= 1.1, and the two places that that I did not include |
OK, I'm merging this for now. |
…pr-2425_pr-2426_pr-2426_pr-2426_pr-2431_pr-2433_pr-2436_pr-2436_pr-2443_commit-91ed1c0b_pr-2450_pr-2450_pr-2451_pr-2452_pr-2452_pr-2462_pr-2462_pr-2463_pr-2464_pr-2464_pr-2466_pr-2467_ [1.1.x] set package long description (#2407) | fix dashboard graph metric list icon paths with URL_PREFIX (#2424) | docs: for sql db migration to 1.1 recommend --fake-initial (#2425) | add tag formatting docs (#2426) | Update tags.rst (#242
... and --run-syncdb should no longer be needed.
Initial migrations were created for all models just before 1.1.0
in d1912d4. Prior to that, some models did not have any
migrations (and no initial migration), so --run-syncdb was needed
to create tables for them. But now that they have initial migrations,
those migrations run because django knows they have never been
applied, and they fail because the tables already exist. The
--fake-initial option is designed for this situation: it considers
initial migrations already applied if the tables already exist.
fixes #2412
replaces #2126
conflicts with #2409 and this is a tiny change so I'd be fine with rebasing this after that lands