Commit Graph

38 Commits

Author SHA1 Message Date
Jon Dufresne 4468c08d70 Fixed #23968 -- Replaced list comprehension with generators and dict comprehension 2014-12-08 07:58:23 -05:00
Tim Heap deb607648e Fixed #23728 -- Added the --exit option to makemigrations.
If no changes that need migrations are found, `makemigrations --exit`
exits with error code 1.
2014-11-28 07:48:39 -05:00
Brad Walker 54d3dcbc51 Removed reduce() usage in makemigrations; refs #23796.
A lambda all_items_equal() replaced a reduce() that was broken for potential
3+-way merges. A reduce(operator.eq, ...) accumulates bools and can't
generically check equality of all items in a sequence:

>>> bool(reduce(operator.eq, [('migrations', '0001_initial')] * 3))
False

The code now counts the number of common ancestors to calculate slice offsets
for the branches. Each branch shares the same number of common ancestors.

The common_ancestor for loop statement had incomplete branch coverage.
2014-11-20 14:33:30 -05:00
Tim Graham 1101467ce0 Limited lines to 119 characters in django/
refs #23395.
2014-09-05 09:22:16 -04:00
Raffaele Salmaso 1435cfbe8d Fixed #23302 -- Added --name/-n option to makemigrations command 2014-09-02 21:09:18 -04:00
Huu Nguyen f7a78f9bba Fixed #22791 -- Invoke interactive questioner only for conflicts in specified apps.
Thanks bendavis78 for the report and Tim Graham for the review.
2014-07-14 11:00:49 -04:00
Huu Nguyen fbb684d95e Fixed #22862 -- Added --noinput option to makemigrations.
Thanks artortenburger for the report.
2014-06-20 08:55:02 -04:00
Andrew Godwin 2b79be2bee Fixed #22848: Ignore no-migrations errors during makemigrations only 2014-06-16 09:58:35 -07:00
Claude Paroz f17b24e407 Converted remaining management commands to argparse 2014-06-14 13:43:44 +02:00
Andrew Godwin 3f91238adf Fixed #22777: Add dependency on through for autodetected M2M adds 2014-06-08 17:12:59 -07:00
Moayad Mardini 2e613ea5c5 Fixed #22675 -- makemigrations --dry-run to output migrations to stdout.
`makemigrations --dry-run` will output the complete migrations file
that would be written if it's used along with `--verbosity 3`.
2014-05-27 00:40:55 +03:00
Moayad Mardini 63fc91b3ca Fixed #22676 -- makemigrations --dry-run should not ask for defaults
Made the fix in InteractiveMigrationQuestioner class code, rather than
MigrationAutodetector, because --dry-run shouldn't affect whether
MigrationAutodetector will detect non-nullable fields, but the
questioner should skip the question and returns a None for default
(since that won't be used anyway) if --dry-run is used.
2014-05-24 09:56:18 -04:00
Claude Paroz fc32e9c0d9 Removed unused imports in makemigrations 2014-05-08 19:39:43 +02:00
Andrew Godwin f9d7e18dc5 Fixed #22576: Ensure makemigrations doesn't touch the database. 2014-05-06 22:41:59 -07:00
Andrew Godwin e049c88603 Cleanup failing test w/contenttypes and remove useless graph load 2014-04-30 15:11:52 -07:00
Andrew Godwin 8f6dff372b Fixed #22485: Include all unmigrated apps in project state by default. 2014-04-30 12:25:12 -07:00
Bruno Ribeiro da Silva 83413c53d2 Fixed #22511 -- Added args to migrations management commands. 2014-04-30 07:15:03 -04:00
Andrew Godwin 28779abb75 Fix bad conflict detection during makemigrations 2014-03-08 13:53:20 -08:00
Andrew Godwin b333de0f5d Add --empty option to makemigrations 2014-02-12 17:16:40 +00:00
Andrew Godwin 2085f53f56 Fixed #21968: Bad detection of old-style apps to add initial migration 2014-02-09 11:42:10 +00:00
Aymeric Augustin 1716b7ce5a Renamed AppCache to Apps.
Also renamed app_cache to apps and "app cache" to "app registry".

Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
2013-12-24 12:25:17 +01:00
Aymeric Augustin 2fef9e5375 Moved apps back in the toplevel django namespace.
Reverted 4a56a93cc4.
2013-12-22 11:39:55 +01:00
Aymeric Augustin 4a56a93cc4 Moved the new app cache inside core. 2013-12-17 10:17:46 +01:00
Aymeric Augustin 69039becde Deprecated get_app(). 2013-12-17 10:17:45 +01:00
Aymeric Augustin 8662654d6d Removed module-level functions for the app cache.
Since the original ones in django.db.models.loading were kept only for
backwards compatibility, there's no need to recreate them. However, many
internals of Django still relied on them.

They were also imported in django.db.models. They never appear in the
documentation, except a quick mention of get_models and get_app in the
1.2 release notes to document an edge case in GIS. I don't think that
makes them a public API.

This commit doesn't change the overall amount of global state but
clarifies that it's tied to the app_cache object instead of hiding it
behind half a dozen functions.
2013-12-17 10:17:44 +01:00
Aymeric Augustin 860c2c8bc5 Moved django.db.models.loading to django.apps.cache.
This commit doesn't contain any code changes; it's purely a refactoring.
2013-12-17 10:17:43 +01:00
Andrew Godwin 4ca39684ee Fix poor variable name (flake8 warning) 2013-12-05 14:11:46 +00:00
Andrew Godwin 3b8e46cbc7 Migration VCS conflict detection and --merge for makemigrations 2013-12-04 16:01:49 +00:00
Andrew Godwin ab587fa51a Add --dry-run option to makemigrations 2013-12-04 13:55:20 +00:00
Javed Khan a921f06345 Fixed #21280 -- Don't generate empty migration files 2013-10-17 08:21:17 -04:00
Markus Holtermann bd8e1a354c Fixed #20977 -- Fixed writing migrations to disk on Python 3 2013-09-06 09:51:58 -04:00
Andrew Godwin beefac8aae Only create the migration directory once per app 2013-08-21 22:32:05 +01:00
Andrew Godwin 2e7f45a372 Change autodetector changes API to be just one method 2013-08-21 22:25:15 +01:00
Andrew Godwin 841b7af812 Use DEFAULT_DB_ALIAS 2013-08-12 16:40:41 +01:00
Andrew Godwin d5a7a3d6a8 Add clarifying comment 2013-08-10 21:04:59 +01:00
Andrew Godwin 3f1f91f155 Print all bad apps passed to makemigrations, not just the first one. 2013-08-10 20:02:55 +01:00
Andrew Godwin b3cec920a2 Remove other color_style override 2013-08-09 17:39:07 +01:00
Andrew Godwin 0e8ee50e86 Rename makemigration to makemigrations 2013-06-20 15:27:33 +01:00