64 Commits

Author SHA1 Message Date
Tianyi Wang
3f3bed8fb9 [1.7.x] Fixed #23629 -- Allowed autodetector to detect changes in Meta.db_table.
Thanks Naddiseo for reporting.

Backport of 5732424bee from master
2014-10-20 13:15:34 -04:00
Markus Holtermann
71988ed953 [1.7.x] Fixed #23609 -- Fixed IntegrityError that prevented altering a NULL column into a NOT NULL one due to existing rows
Thanks to Simon Charette, Loic Bistuer and Tim Graham for the review.

Backport of f633ba778d from master
2014-10-09 22:41:27 +07:00
Markus Holtermann
00c2a721e2 [1.7.x] Fixed #23415 -- Added fields for unmanaged and proxy model migrations.
Thanks sky-chen for the report.

Backport of 215aa4f53b from master
2014-09-25 10:28:11 -04:00
Markus Holtermann
67872bfff1 [1.7.x] Fixed #23452 -- Prevented infinite migrations for empty unique/index_together.
Thanks fwkroon for the report.

Backport of 6d5958c7a3 from master
2014-09-10 07:57:31 -04:00
Andrew Pinkham
27e7972e63 [1.7.x] Fixed #22951 -- Checked for types during deep_deconstruct migration serializ
Thanks Sam Hartsfield for the report.

Backport of 4680d25df2 from master
2014-09-08 07:58:06 -04:00
Raffaele Salmaso
1a918806ca [1.7.x] Fixed #23341 -- Added migration name to nonexistent migration error in makemigrations.
Backport of abd640fbdf from master
2014-08-23 19:19:58 -04:00
Markus Holtermann
2da20379c0 [1.7.x] Fixed #23322 -- Use resolved swappable model for dependency resolution during makemigrations
Backport of 144cff3f51 from master
2014-08-20 16:08:49 -04:00
Tim Graham
6981eced83 [1.7.x] Fixed migrations tests added in refs #23315.
Backport of d1299fce0e from master
2014-08-20 14:01:50 -04:00
Andrew Godwin
824e02bf83 [1.7.x] Fixed #23315: Operational dependency fail with mixed create/add 2014-08-19 19:51:23 -07:00
Andrew Godwin
72fdd62e93 [1.7.x] Fixed #23275: Unmanaged models kept by autodetector, ignored by ops 2014-08-12 12:51:11 -07:00
Andrew Godwin
0a4fbf4e13 [1.7.x] Fixed #23101: Prefer doing deletes before creates in autodetector.
Makes declined or missed renames still work (but drop data).
2014-07-29 09:39:01 -07:00
Andrew Godwin
394053ce60 [1.7.x] Fixed #23121: AlterModelOptions operation not changing state right 2014-07-28 10:47:55 -07:00
Andrew Godwin
d84b881600 [1.7.x] Fixed #23100: Individual FK creation missing dependencies 2014-07-28 10:33:28 -07:00
Andrew Godwin
7e708a2536 [1.7.x] Fixed #22944: Bad dependency on FK alteration in autodetector 2014-07-26 09:22:31 -07:00
Jeroen Dekkers
6e7e5bacd5 [1.7.x] Fixed #23071 -- Use last migration's name in dependency to other app
Changed the autodetector to lookup the name of the other app's last
migration in the graph and use that as dependency instead of using
__latest__.
2014-07-25 08:54:54 -07:00
Tim Graham
b918bc921c [1.7.x] Fixed #23014 -- Infinite migration regression with unique/index_together.
Backport of 64e75c47ef from master
2014-07-24 14:30:16 -04:00
Andrew Godwin
de709001c4 [1.7.x] Fixed #23041: Bad base dependencies for proxy models 2014-07-16 09:59:37 -07:00
Tim Graham
fe5f29eb1d [1.7.x] Fixed #23008 -- Fixed typo causing bad migration dependencies.
Thanks semenov for the report and Florian for investigation.

Backport of 9a2ab62977 from master
2014-07-15 08:51:16 -04:00
Andrew Godwin
eb7e232e7f [1.7.x] Fix comment 2014-07-10 10:01:12 -07:00
Andrew Godwin
aba75e73db [1.7.x] Fixed #22970: Incorrect dependencies for existing migrated apps 2014-07-09 23:53:53 -07:00
Andrew Godwin
1f889800d6 [1.7.x] Fixed #22960: Bad handling of relations as PKs in autodetector 2014-07-05 16:33:34 -07:00
Tim Graham
f1428dc796 [1.7.x] Fixed #22903 -- Fixed migration generation if index_together or unique_together is removed from a model.
Backport of e0cd07ec2f from master
2014-06-25 10:04:46 -04:00
Andrew Godwin
48a2e027bf [1.7.x] Fixed #22708: Typo in autodetector base dependency gen 2014-06-23 20:48:59 -07:00
Andrew Godwin
d9a7663b11 [1.7.x] Fixed #22783: Make sure swappable models come first in creation 2014-06-16 10:20:52 -07:00
Andrew Godwin
a81282a512 [1.7.x] Fixed #22568: Better proxy model support in migrations 2014-06-15 16:02:24 -07:00
Andrew Godwin
e5cde2062c [1.7.x] Fixed #22470: Full migration support for order_with_respect_to 2014-06-15 14:57:00 -07:00
Andrew Godwin
3ef87f664b [1.7.x] Persist non-schema-relevant Meta changes in migrations 2014-06-15 12:34:34 -07:00
Andrew Godwin
13aa079941 [1.7.x] Fixed #22833: Autodetector not doing through mapping correctly 2014-06-15 12:07:27 -07:00
Andrew Godwin
55fa4c2d34 [1.7.x] Fixed #22777: Add dependency on through for autodetected M2M adds 2014-06-08 17:13:11 -07:00
Andrew Godwin
b568bdf8da [1.7.x] Fixed #22750, #22248: Model renaming now also alters field FKs 2014-06-07 18:18:18 -07:00
Andrew Godwin
31fc34e447 [1.7.x] Rewrote migration autodetector to involve actual computer science.
Fixes #22605, #22735; also lays the ground for some other fixes.

Conflicts:
	django/db/migrations/autodetector.py
2014-06-05 23:27:21 -07:00
Simon Charette
33511662dd [1.7.x] Fixed #22659 -- Prevent model states from sharing field instances.
Thanks to Trac alias tbartelmess for the report and the test project.

Backport of 7a38f88922 from master
2014-06-01 15:12:23 -04:00
Claude Paroz
e8a7436941 [1.7.x] Harmonized some PEP 0263 coding preambles
Backport of e520a73ee from master.
2014-05-15 20:01:31 +02:00
Tim Graham
f8fa735dc2 [1.7.x] Fixed #22435 -- Prevented adding a ManyToManyField from prompting for a default.
Thanks andrewsg for the report.

Backport of 3818d96426 from master
2014-05-02 20:53:39 -04:00
Chris Beaven
5ab93bbe74 [1.7.x] Fix migration autodector to work correctly with custom deconstructed values 2014-05-02 15:12:42 +12:00
Tim Graham
9e86c3f0a6 [1.7.x] Fixed flake8 errors.
Backport of 471fb04a30 from master
2014-04-20 13:09:12 -04:00
Andrew Gorcester
bc5d568e1e [1.7.x] Fixed #22397 -- Issues removing M2M field with explicit through model
Changed the migration autodetector to remove models last so that FK
and M2M fields will not be left as dangling references. Added a check
in the migration state renderer to error out in the presence of
dangling references instead of leaving them as strings. Fixed a bug
in the sqlite backend to handle the deletion of M2M fields with
"through" models properly (i.e., do nothing successfully).

Thanks to melinath for report, loic for tests and andrewgodwin and
charettes for assistance with architecture.

Backport of 956bd64424 from master
2014-04-18 18:34:00 -04:00
Loic Bistuer
8e73d3a2c1 [1.7.x] Fixed #22319 -- Fixed migration external dependencies when there are internal dependencies.
Backport of 0fd51cf0bd from master
2014-03-31 06:57:44 -04:00
Loic Bistuer
39fc8d4b8e [1.7.x] Fixed #22331 -- Made MigrationAutodetector ignore unmanaged models.
This commit reverts 69d4b1c and tackle the issue from a different angle.
Models remain present in the project state, but are now ignored by the
autodetector.

Backport of 42336c84a0daedfd8242333622eefe202e32398e from master
2014-03-25 20:04:49 -04:00
Stephen Burrows
b4f165fe94 [1.7.x] Fixed #22300 -- Fixed crash in migrations when changing non-relational field to relational.
Backport of 35ed792cf2 from master
2014-03-25 07:46:48 -04:00
Andrew Godwin
81f5408c7a Fixed #22275: unique_together broken if ForeignKey split into new file.
Thanks to bak1an for the patch.
2014-03-19 21:23:21 -07:00
Chris Beaven
40f6ca54f8 Fix autodetector creation of RenameModel migration to capitalize model names 2014-03-11 12:23:45 +13:00
Chris Beaven
7feb70eef3 Fixed #22239 -- Add auto detection of renamed models 2014-03-10 13:55:44 +13:00
Andrew Godwin
e46e15e5a1 Fixed #22204: Bad circular-dep-breaking if more than one per run 2014-03-06 13:22:42 -08:00
Andrew Godwin
3c547a423f Merge pull request #2270 from bmispelon/ticket-22030
Fixed #22030 -- Don't assume that all fields have a swappable_setting at...
2014-02-17 01:16:49 +00:00
Anton Baklanov
0bd92d68ad Fixed #22035 -- reordered migration operations
Now AddField actions appear in operations list before AlterUniqueTogether
actions.

Thanks to SmileyChris for the report.
2014-02-14 20:00:39 -05:00
Baptiste Mispelon
6873eeeefb Fixed #22030 -- Don't assume that all fields have a swappable_setting attribute. 2014-02-13 17:43:21 +01:00
Andrew Godwin
bad9456b9c Fix my slightly hasty autodetector changes 2014-02-12 17:22:50 +00:00
Andrew Godwin
c9de1b4a55 Implement swappable model support for migrations 2014-01-19 16:43:12 +00:00
Andrew Godwin
3b8e46cbc7 Migration VCS conflict detection and --merge for makemigrations 2013-12-04 16:01:49 +00:00