summaryrefslogtreecommitdiff
path: root/django/core/management/sql.py
Commit message (Collapse)AuthorAgeFilesLines
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-7/+13
|
* Fixed #32395 -- Allowed capturing stdout of migration signals.Simon Charette2021-02-041-2/+6
|
* Refs #5086 -- Removed unused only_django argument from sql_flush().Jon Dufresne2020-06-041-8/+2
| | | Unused (always True) since its introduction in 132605d889db8767a40243259066b8450428714c.
* Fixed #31473 -- Made sql_flush() use RESTART IDENTITY to reset sequences on ↵Jon Dufresne2020-04-171-2/+6
| | | | | | | | | | | | PostgreSQL. The sql_flush() positional argument sequences is replaced by the boolean keyword-only argument reset_sequences. This ensures that the old function signature can't be used by mistake when upgrading Django. When the new argument is True, the sequences of the truncated tables will reset. Using a single boolean value, rather than a list, allows making a binary yes/no choice as to whether to reset all sequences rather than a working on a completely different set.
* Removed unnecessary assignments in various code.Jon Dufresne2019-04-241-2/+1
|
* Refs #27656 -- Updated django.core docstring verbs according to PEP 257.Anton Samarchyan2017-02-211-3/+3
|
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-181-2/+0
|
* Fixed #24100 -- Made the migration signals dispatch its plan and apps.Simon Charette2016-05-151-4/+8
| | | | Thanks Markus for your contribution and Tim for your review.
* Removed support for syncing apps without migrations per deprecation timeline.Tim Graham2015-01-181-147/+1
| | | | | Kept support for creating models without migrations when running tests (especially for Django's test suite).
* Required sqlparse for SQL splitting per deprecation timeline.Tim Graham2015-01-171-18/+0
|
* Removed support for custom SQL per deprecation timeline.Tim Graham2015-01-171-58/+0
|
* Removed pre_syncdb and post_syncdb signals per deprecation timeline.Tim Graham2015-01-171-18/+2
|
* Fixed #23866 -- Harmonized refs to Django documentation from codeClaude Paroz2014-12-251-3/+6
|
* Fixed #23968 -- Replaced list comprehension with generators and dict ↵Jon Dufresne2014-12-081-2/+2
| | | | comprehension
* Normalized opening a file and decoding its content.Aymeric Augustin2014-11-111-2/+2
| | | | `io.open` is required on Python 2.7. Just `open` would work on Python 3.
* Fixed #18782 -- Prevented sql_flush to flush viewsClaude Paroz2014-09-231-2/+2
| | | | | Thanks rodolfo_3 for the report and the initial patch, and Josh Smeaton, Shai Berger and Tim Graham for the reviews.
* Limited lines to 119 characters in django/Tim Graham2014-09-051-2/+9
| | | | refs #23395.
* Fixed #23379 -- Corrected a referencing issue in sql_create.Simon Charette2014-08-281-1/+1
| | | | Thanks to Trac alias flakfizer for the report.
* Fixed #23136 -- Added a message when sqlclear does nothingGabriel Muñumel2014-08-181-0/+2
|
* Fixed #22749: Making SQL management commands migration aware.Víðir Valberg Guðmundsson2014-06-071-2/+26
|
* Revert "Making SQL management commands migration aware."Florian Apolloner2014-06-011-24/+0
| | | | This reverts commit cb9c9a7b5879671053c7d2ad6e79943a8814b274.
* Fix test failure caused by 3149cdce32e7261b2d44128ab712c4d4f1a5d429Andrew Godwin2014-05-291-1/+2
|
* Making SQL management commands migration aware.Víðir Valberg Guðmundsson2014-05-291-0/+23
|
* Removed unused import.Tim Graham2014-04-301-1/+0
|
* Removed bogus, ineffective 'U' flag from codecs.open() call.Ramiro Morales2014-04-291-1/+1
|
* Fixed #3214 -- Stopped parsing SQL with regex.Aymeric Augustin2014-04-261-3/+2
| | | | | | | | | | | | | | | | | | | | Avoided introducing a new regex-based SQL splitter in the migrations framework, before we're bound by backwards compatibility. Adapted this change to the legacy "initial SQL data" feature, even though it's already deprecated, in order to facilitate the transition to migrations. sqlparse becomes mandatory for RunSQL on some databases (all but PostgreSQL). There's no API to provide a single statement and tell Django not to attempt splitting. Since we have a more robust splitting implementation, that seems like a good tradeoff. It's easier to add a new keyword argument later if necessary than to remove one. Many people contributed to both tickets, thank you all, and especially Claude for the review. Refs #22401.
* Revert "Fixed #22401 -- Deprecated regular expression parsing of initial SQL ↵Tim Graham2014-04-161-22/+13
| | | | | | | | in favor of installing sqlparse." This reverts commit 071c9337750b296d198cced56f3ffad0e176afb6. This introduced a regression on MySQL and custom SQL is deprecated.
* Fixed #22401 -- Deprecated regular expression parsing of initial SQL in ↵julien 'pouete' Godin2014-04-091-13/+22
| | | | favor of installing sqlparse.
* Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warningsClaude Paroz2014-03-081-1/+2
| | | | | Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
* Ensure cursors are closed when no longer needed.Michael Manfre2014-02-021-32/+33
| | | | | | This commit touchs various parts of the code base and test framework. Any found usage of opening a cursor for the sake of initializing a connection has been replaced with 'ensure_connection()'.
* Remove unneded open(.., 'U') when on python 3.Marc Tamlyn2014-01-131-1/+2
| | | | | Universal newlines is enabled by default on py3, and the usage of 'U' is deprecated in py3.4.
* Fixed #21477 -- Renamed db to using in pre/post_migrate signals.Aymeric Augustin2014-01-121-2/+2
|
* Removed the only_with_models_module argument of get_model[s].Aymeric Augustin2013-12-301-2/+6
| | | | | | | Now that the refactorings are complete, it isn't particularly useful any more, nor very well named. Let's keep the API as simple as possible. Fixed #21689.
* Changed get_migratable_models to use an app config.Aymeric Augustin2013-12-291-5/+5
|
* Changed sql_* to use an app config instead of a models module.Aymeric Augustin2013-12-291-13/+13
|
* Refactored the migration signals to use app configs.Aymeric Augustin2013-12-291-0/+14
| | | | | De-aliased pre/post_syncdb to pre/post_migrate to increase backwards-compatibility.
* Renamed AppCache to Apps.Aymeric Augustin2013-12-241-5/+5
| | | | | | Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
* Moved apps back in the toplevel django namespace.Aymeric Augustin2013-12-221-1/+1
| | | | Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
* Moved the new app cache inside core.Aymeric Augustin2013-12-171-1/+1
|
* Made it possible to create apps without a models module.Aymeric Augustin2013-12-171-2/+2
| | | | | | | This commit reverts f44c4a5d0f and 39bbd165. django.test.simple will be updated in a separate commit as it requires invasive changes.
* Deprecated get_apps().Aymeric Augustin2013-12-171-14/+18
|
* Deprecated get_app_package, get_app_path and get_app_paths.Aymeric Augustin2013-12-171-1/+1
|
* Removed module-level functions for the app cache.Aymeric Augustin2013-12-171-4/+5
| | | | | | | | | | | | | | | 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.
* Add get_migratable_models util method to ConnectionRouterClaude Paroz2013-10-161-13/+5
|
* Fixed #19657 -- Made sql commands honor allow_migrateClaude Paroz2013-10-161-7/+14
| | | | | Thanks Manel Clos for the report and the initial patch, and Marc Tamlyn and Tim Graham for the review.
* Fixed #21189: Cleaned up usage of bare except clauses.Baptiste Mispelon2013-10-051-1/+1
| | | | | Thanks to berkerpeksag for the report and to claudep for the review.
* Fixed a number of flake8 errors -- particularly around unused imports and ↵Alex Gaynor2013-09-061-1/+0
| | | | local variables
* Fixed #20989 -- Removed useless explicit list comprehensions.Simon Charette2013-08-301-1/+1
|
* Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin2013-08-091-3/+17
|\ | | | | | | | | | | | | | | | | | | Conflicts: django/core/management/commands/flush.py django/core/management/commands/syncdb.py django/db/models/loading.py docs/internals/deprecation.txt docs/ref/django-admin.txt docs/releases/1.7.txt
| * Fixed #14300 -- Fixed initial SQL location if models is a package.Tim Graham2013-07-241-3/+17
| | | | | | | | Thanks al_the_x for the report and fheinz for the draft patch.