summaryrefslogtreecommitdiff
path: root/django/core/management/sql.py
AgeCommit message (Collapse)Author
2010-12-12Fixed #14268 -- Start the deprecation of the reset and sqlreset management ↵Jannis Leidel
command. Thanks, Carl. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14888 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-31When looking for django tables which exist, query for all tables once, not ↵Alex Gaynor
once *per table*. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14402 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-09Fixed #14356. Remove some dead imports from django.core.management.sql. ↵Alex Gaynor
Thanks to xiaket for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14088 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-06Negligible formatting improvement to an error in management/sql.pyAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13992 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-04Fixed #12164 -- Removed the Python 2.3 compatibility imports and ↵Russell Keith-Magee
workarounds. Thanks to timo and claudep for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13094 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-27Fixed #11969 -- `Field.post_create_sql` hook should not be called for ↵Justin Bronn
unmanaged models. Thanks, jtiai for report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12313 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22Fixed #1142 -- Added multiple database support.Russell Keith-Magee
This monster of a patch is the result of Alex Gaynor's 2009 Google Summer of Code project. Congratulations to Alex for a job well done. Big thanks also go to: * Justin Bronn for keeping GIS in line with the changes, * Karen Tracey and Jani Tiainen for their help testing Oracle support * Brett Hoerner, Jon Loyens, and Craig Kimmerer for their feedback. * Malcolm Treddinick for his guidance during the GSoC submission process. * Simon Willison for driving the original design process * Cal Henderson for complaining about ponies he wanted. ... and everyone else too numerous to mention that helped to bring this feature into fruition. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-11-03Fixed #10109 -- Removed the use of raw SQL in many-to-many fields by ↵Russell Keith-Magee
introducing an autogenerated through model. This is the first part of Alex Gaynor's GSoC project to add Multi-db support to Django. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11710 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-29Fixed #9717 -- Corrected a problem where django-admin.py flush would attempt ↵Russell Keith-Magee
to flush database tables that had not yet been created. This occurred when an application had been added to INSTALLED_APPS, but had not yet been synchronized. Thanks to Julien Phalip for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9535 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-16Fixes #7845: Removed a piece of stale code that was causing ./manage.py ↵Russell Keith-Magee
reset to fail with apps that don't have any models. Thanks to miracle2k for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8401 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-11Fixed #5461 -- Refactored the database backend code to use classes for the ↵Russell Keith-Magee
creation and introspection modules. Introduces a new validation module for DB-specific validation. This is a backwards incompatible change; see the wiki for details. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8296 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-06Major refactoring of django.dispatch with an eye towards speed. The net ↵Jacob Kaplan-Moss
result is that signals are up to 90% faster. Though some attempts and backwards-compatibility were made, speed trumped compatibility. Thus, as usual, check BackwardsIncompatibleChanges for the complete list of backwards-incompatible changes. Thanks to Jeremy Dunck and Keith Busell for the bulk of the work; some ideas from Brian Herring's previous work (refs #4561) were incorporated. Documentation is, sigh, still forthcoming. Fixes #6814 and #3951 (with the new dispatch_uid argument to connect). git-svn-id: http://code.djangoproject.com/svn/django/trunk@8223 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-31Fixed #8053 -- Corrected a bug with reset and m2m intermediate tables. ↵Russell Keith-Magee
Thanks to d00gs for the report and fix. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8157 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-29Fixed #6095 -- Added the ability to specify the model to use to manage a ↵Russell Keith-Magee
ManyToManyField. Thanks to Eric Florenzano for his excellent work on this patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8136 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-29Fixed #7589 -- Added a way for post-table-creation SQL modifications to be ↵Malcolm Tredinnick
done for custom fields (needed by geo-django, but useful in other situations, too). Patch from Justin Bronn. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8133 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30Make sure we only create the minimum number of table indexes for MySQL.Malcolm Tredinnick
This patch simplifies a bunch of code for all backends and removes some duplicate index creation for MySQL, in particular (versions 4.x and later). Patch from Nis Jørgensen. Fixed #5671, #5680, #7170, #7186. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7790 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-08Fixed #6394: improved comment stripping in initial SQL files. Thanks, Thomas ↵Jacob Kaplan-Moss
Guttler. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7591 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-05-31Fixed #6820: flush no longer fails under PostgreSQL 8.3. WARNING: In the ↵Jacob Kaplan-Moss
process I renamed a couple of internal functions in django.core.management.sql, so this is a backwards-incompatible change if you were using those internal functions. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7568 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-27Merged the queryset-refactor branch into trunk.Malcolm Tredinnick
This is a big internal change, but mostly backwards compatible with existing code. Also adds a couple of new features. Fixed #245, #1050, #1656, #1801, #2076, #2091, #2150, #2253, #2306, #2400, #2430, #2482, #2496, #2676, #2737, #2874, #2902, #2939, #3037, #3141, #3288, #3440, #3592, #3739, #4088, #4260, #4289, #4306, #4358, #4464, #4510, #4858, #5012, #5020, #5261, #5295, #5321, #5324, #5325, #5555, #5707, #5796, #5817, #5987, #6018, #6074, #6088, #6154, #6177, #6180, #6203, #6658 git-svn-id: http://code.djangoproject.com/svn/django/trunk@7477 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-27Added inline Oracle tablespace SQL for unique_together constraints.Ian Kelly
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7375 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-10Fixed #6374: cross-app and circular FK constraints are now detected and ↵Jacob Kaplan-Moss
added correctly. Thanks, dready. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7215 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-04Fixed the Oracle backend mangling colorized unique_together SQL.Ian Kelly
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6994 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-17Generic relations should not try to drop their related table in "sqlreset".Malcolm Tredinnick
Fixed #3480. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6921 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-04Fixed #5729 -- For MySQL (only), always delay the creation of foreign keyMalcolm Tredinnick
references, for all tables, until after the table has been created. This means that when using the InnoDB storage engine, true foreign key constraints are created (inline "REFERENCES" are ignored by InnoDB, unfortunately). Fully backwards compatible. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6650 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15Fixed two more instances of bug #4827 in the management code.Ian Kelly
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6298 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14Fixed #5218: Made Oracle create autoinc triggers using the correct name Ian Kelly
of the AutoField column rather than always assume "ID". git-svn-id: http://code.djangoproject.com/svn/django/trunk@6195 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-25Fixed #5086 -- The 'flush' and 'sqlflush' management commands no longer ↵Adrian Holovaty
touch tables that Django is not aware of (tables that are not in INSTALLED_APPS and/or do not have associated models. Thanks for bringing this up, shaun@cuttshome.net git-svn-id: http://code.djangoproject.com/svn/django/trunk@6013 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Removed legacy django.db.backend import in sql_delete()Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5980 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Refactored get_drop_sequence() to DatabaseOperations.drop_sequence_sql(). ↵Adrian Holovaty
Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5978 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Removed a bunch of legacy django.db.backend importsAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5975 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Implemented BaseDatabaseFeatures and changed all code to access it -- ↵Adrian Holovaty
connection.features.foo instead of backend.foo git-svn-id: http://code.djangoproject.com/svn/django/trunk@5974 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Refactored quote_name() to DatabaseOperations.quote_name(). Refs #5106Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5967 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Refactored get_tablespace_sql() to DatabaseOperations.tablespace_sql(). Refs ↵Adrian Holovaty
#5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5966 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20Refactored get_sql_flush() to DatabaseOperations.sql_flush(). Refs #5106Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5963 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Refactored get_max_name_length() to DatabaseOperations.max_name_length(). ↵Adrian Holovaty
Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5960 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Refactored get_drop_foreignkey_sql() to ↵Adrian Holovaty
DatabaseOperations.drop_foreignkey_sql(). Refs #5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5956 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Refactored get_deferrable_sql() to DatabaseOperations.deferrable_sql(). Refs ↵Adrian Holovaty
#5106 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5955 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19Began implementing BaseDatabaseOperations class for every database backend. ↵Adrian Holovaty
This class will be used to hold the database-specific methods that currently live at the module level in each backend. Only autoinc_sql() has been implemented so far. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5950 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-16Major refactoring of django.core.management -- it's now a package rather ↵Adrian Holovaty
than a 1730-line single module. All django-admin/manage.py commands are now stored in separate modules. This is backwards-incompatible for people who used django.core.management functions directly git-svn-id: http://code.djangoproject.com/svn/django/trunk@5898 bcc190cf-cafb-0310-a4f2-bffc1f526a37