summaryrefslogtreecommitdiff
path: root/django/core/management/sql.py
AgeCommit message (Collapse)Author
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-02-04Fixed #32395 -- Allowed capturing stdout of migration signals.Simon Charette
2020-06-04Refs #5086 -- Removed unused only_django argument from sql_flush().Jon Dufresne
Unused (always True) since its introduction in 132605d889db8767a40243259066b8450428714c.
2020-04-17Fixed #31473 -- Made sql_flush() use RESTART IDENTITY to reset sequences on ↵Jon Dufresne
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.
2019-04-24Removed unnecessary assignments in various code.Jon Dufresne
2017-02-21Refs #27656 -- Updated django.core docstring verbs according to PEP 257.Anton Samarchyan
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-05-15Fixed #24100 -- Made the migration signals dispatch its plan and apps.Simon Charette
Thanks Markus for your contribution and Tim for your review.
2015-01-18Removed support for syncing apps without migrations per deprecation timeline.Tim Graham
Kept support for creating models without migrations when running tests (especially for Django's test suite).
2015-01-17Required sqlparse for SQL splitting per deprecation timeline.Tim Graham
2015-01-17Removed support for custom SQL per deprecation timeline.Tim Graham
2015-01-17Removed pre_syncdb and post_syncdb signals per deprecation timeline.Tim Graham
2014-12-25Fixed #23866 -- Harmonized refs to Django documentation from codeClaude Paroz
2014-12-08Fixed #23968 -- Replaced list comprehension with generators and dict ↵Jon Dufresne
comprehension
2014-11-11Normalized opening a file and decoding its content.Aymeric Augustin
`io.open` is required on Python 2.7. Just `open` would work on Python 3.
2014-09-23Fixed #18782 -- Prevented sql_flush to flush viewsClaude Paroz
Thanks rodolfo_3 for the report and the initial patch, and Josh Smeaton, Shai Berger and Tim Graham for the reviews.
2014-09-05Limited lines to 119 characters in django/Tim Graham
refs #23395.
2014-08-28Fixed #23379 -- Corrected a referencing issue in sql_create.Simon Charette
Thanks to Trac alias flakfizer for the report.
2014-08-18Fixed #23136 -- Added a message when sqlclear does nothingGabriel Muñumel
2014-06-07Fixed #22749: Making SQL management commands migration aware.Víðir Valberg Guðmundsson
2014-06-01Revert "Making SQL management commands migration aware."Florian Apolloner
This reverts commit cb9c9a7b5879671053c7d2ad6e79943a8814b274.
2014-05-29Fix test failure caused by 3149cdce32e7261b2d44128ab712c4d4f1a5d429Andrew Godwin
2014-05-29Making SQL management commands migration aware.Víðir Valberg Guðmundsson
2014-04-30Removed unused import.Tim Graham
2014-04-29Removed bogus, ineffective 'U' flag from codecs.open() call.Ramiro Morales
2014-04-26Fixed #3214 -- Stopped parsing SQL with regex.Aymeric Augustin
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.
2014-04-16Revert "Fixed #22401 -- Deprecated regular expression parsing of initial SQL ↵Tim Graham
in favor of installing sqlparse." This reverts commit 071c9337750b296d198cced56f3ffad0e176afb6. This introduced a regression on MySQL and custom SQL is deprecated.
2014-04-09Fixed #22401 -- Deprecated regular expression parsing of initial SQL in ↵julien 'pouete' Godin
favor of installing sqlparse.
2014-03-08Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warningsClaude Paroz
Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
2014-02-02Ensure cursors are closed when no longer needed.Michael Manfre
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()'.
2014-01-13Remove unneded open(.., 'U') when on python 3.Marc Tamlyn
Universal newlines is enabled by default on py3, and the usage of 'U' is deprecated in py3.4.
2014-01-12Fixed #21477 -- Renamed db to using in pre/post_migrate signals.Aymeric Augustin
2013-12-30Removed the only_with_models_module argument of get_model[s].Aymeric Augustin
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.
2013-12-29Changed get_migratable_models to use an app config.Aymeric Augustin
2013-12-29Changed sql_* to use an app config instead of a models module.Aymeric Augustin
2013-12-29Refactored the migration signals to use app configs.Aymeric Augustin
De-aliased pre/post_syncdb to pre/post_migrate to increase backwards-compatibility.
2013-12-24Renamed AppCache to Apps.Aymeric Augustin
Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
2013-12-22Moved apps back in the toplevel django namespace.Aymeric Augustin
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
2013-12-17Moved the new app cache inside core.Aymeric Augustin
2013-12-17Made it possible to create apps without a models module.Aymeric Augustin
This commit reverts f44c4a5d0f and 39bbd165. django.test.simple will be updated in a separate commit as it requires invasive changes.
2013-12-17Deprecated get_apps().Aymeric Augustin
2013-12-17Deprecated get_app_package, get_app_path and get_app_paths.Aymeric Augustin
2013-12-17Removed module-level functions for the app cache.Aymeric Augustin
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-10-16Add get_migratable_models util method to ConnectionRouterClaude Paroz
2013-10-16Fixed #19657 -- Made sql commands honor allow_migrateClaude Paroz
Thanks Manel Clos for the report and the initial patch, and Marc Tamlyn and Tim Graham for the review.
2013-10-05Fixed #21189: Cleaned up usage of bare except clauses.Baptiste Mispelon
Thanks to berkerpeksag for the report and to claudep for the review.
2013-09-06Fixed a number of flake8 errors -- particularly around unused imports and ↵Alex Gaynor
local variables
2013-08-30Fixed #20989 -- Removed useless explicit list comprehensions.Simon Charette
2013-08-09Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin
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
2013-07-30Rename pre_ and post_syncdb to *_migrate, with aliases from old namesAndrew Godwin