summaryrefslogtreecommitdiff
path: root/django/db
AgeCommit message (Collapse)Author
2014-05-07Fixed #22496: Data migrations get transactions again!Andrew Godwin
2014-05-07Fixed #22581: Pass default values for schema through get_db_prep_save()Andrew Godwin
2014-05-07Fixed #22563: Better error message when trying to change AUTH_USER_MODELAndrew Godwin
You're not allowed to do this after you've made migrations; see ticket for more details.
2014-05-06Fixed #22576: Ensure makemigrations doesn't touch the database.Andrew Godwin
2014-05-06Fixed #22564 -- Prevented unneeded bytestrings in migrationsClaude Paroz
In some cases, this could lead to migrations written with Python 2 being incompatible with Python 3. Thanks Tim Graham for the report and Loïc Bistuer for the advices.
2014-05-06Added a bunch of missing unicode_literalsClaude Paroz
Refs #22564.
2014-05-05Fixed #22466 -- ordering by reverse foreign keyAnssi Kääriäinen
Ordering by reverse foreign key was broken by custom lookups patch (commit 20bab2cf9d02a5c6477d8aac066a635986e0d3f3). Thanks to everybody who helped solving this issue. Special thanks to Trac alias takis for reporting this.
2014-05-05Fixed #22489 -- missing implemenation for search lookupJakub Roztocil
When custom lookups were added, converting the search lookup to use the new Lookup infrastructure wasn't done. Some changes were needed to the added test, main change done by committer was ensuring the test works on MySQL versions prior to 5.6.
2014-05-05Fixed #22429 -- Incorrect SQL when using ~Q and FAnssi Kääriäinen
2014-05-03Moved misplaced transaction.atomic from 0dce44e16bClaude Paroz
Thanks Florian Apolloner for noticing the issue and Aymeric Augustin for the expertise. Refs #22540.
2014-05-02Fixed #22435 -- Prevented adding a ManyToManyField from prompting for a default.Tim Graham
Thanks andrewsg for the report.
2014-05-02Fixed #22540 -- Made _create_object_from_params() call create()Claude Paroz
So as the save step is centralized in create(), especially useful when customizing behavior in subclasses. Thanks craig.labenz@gmail.com for the report.
2014-05-02Fix migration autodector to work correctly with custom deconstructed valuesChris Beaven
2014-05-01Fixed #22539 -- Copied exclude argument in Model.full_clean() to prevent ↵Yehonatan Daniv
side effects.
2014-04-30flake8 fixes.Tim Graham
2014-04-30Fixed #22485: Include all unmigrated apps in project state by default.Andrew Godwin
2014-04-30Fixed #19195 -- Allow explicit ordering by a relation `_id` field.Simon Charette
Thanks to chrisedgemon for the report and shaib, akaariai and timgraham for the review.
2014-04-30Fixed #22474 -- Made migration recorder aware of multiple databasesClaude Paroz
Thanks Tim Graham for the review.
2014-04-29Use the new implementation of `six.with_metaclass`.Simon Charette
No more `NewBase` horrors. Thanks to bendavis78 for his work on merging this into six.
2014-04-26Fix many many typos in comments throughout the codebaseAlex Gaynor
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-25Fixed #21166 -- Reset errors_occurred flag after commit and rollback.Aymeric Augustin
2014-04-25Set some transaction-related feature flags on SQLite.Aymeric Augustin
Refs #22496.
2014-04-25Fixed #22498 -- constraint name was not quoted in FK creation SQLShai Berger
2014-04-25Made sure cursor.close() does not complain if cursor is already closed on OracleShai Berger
Refs #22483
2014-04-24Prevented a crash in the cursor wrappers on Oracle.Aymeric Augustin
Fixed #22483 (again). Forwardport of 5cd6429620 from stable/1.7.x
2014-04-24Ignored repeated calls to connection.close().Aymeric Augustin
Forwardport of 9bbb43dd1a from stable/1.7.x
2014-04-23Used the same instance of atomic for entry and exit.Aymeric Augustin
Since all state is maintained on the connection at this time and none in the atomic, it doesn't matter, but it could introduce some subtle bugs if the implementation changed in the future.
2014-04-23Wrapped migrations in a transaction only on DBs with transactional DDL.Aymeric Augustin
2014-04-21Fixed queries that may return unexpected results on MySQL due to typecasting.Erik Romijn
This is a security fix; disclosure to follow shortly.
2014-04-21Appeased flake8 2.1.0.Aymeric Augustin
2014-04-20Fixed flake8 errors.Tim Graham
2014-04-18Fixed #22397 -- Issues removing M2M field with explicit through modelAndrew Gorcester
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.
2014-04-18Revert "Fixed #22397 -- Issues removing M2M field with explicit through model."Simon Charette
This reverts commit 00e3b9a2a992ee0b7288eeeb03e7cbd52ebc6dce. It's causing a regression when tested with the proxy_model_inheritance tests.
2014-04-17Fixed #22397 -- Issues removing M2M field with explicit through model.Andrew Gorcester
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.
2014-04-16Fixed #22434 -- Retain ordering on related sliced subqueries.Justin Hamade
Thanks maciej.pawlisz for the report, and charettes for the review.
2014-04-16Fixed flake8 warnings introduced in recent commits.Simon Charette
2014-04-16Fixed #22460 -- Explicity remove constraints when dropping a related field.Motiejus Jakštys
2014-04-14Fixed #22356 -- Added a check to make sure unique_together fields are local.Marc Egli
2014-04-13Fixed #22350 -- Consistently serialize bytes and text in migrations.Simon Charette
Thanks to @treyhunner and Loïc for their suggestions and review.
2014-04-13Fixed #21760 -- prefetch_related used an inefficient query for reverse FK.valtron
Regression introduced by commit 9777442. Refs #21410.
2014-04-11Improved a comment. Thanks intgr for the report.Aymeric Augustin
2014-04-10Increased robustness of 58161e4e. Refs #22291.Aymeric Augustin
2014-04-10Fixed #21202 -- Maintained atomicity when the server disconnects.Aymeric Augustin
Thanks intgr for the report. This commit doesn't include a test because I don't know how to emulate a database disconnection in a cross-database compatible way. Also simplified a 'backends' test that was constrained by this problem.
2014-04-10Fixed #21239 -- Maintained atomicity when closing the connection.Aymeric Augustin
Refs #15802 -- Reverted #7c657b24 as BaseDatabaseWrapper.close() now has a proper "finally" clause that may need to preserve self.connection.
2014-04-10Fixed #22321 -- Wrapped exceptions in _set_autocommit.Aymeric Augustin
Refs #21202.
2014-04-10Fixed #22343 -- Disallowed select_for_update in autocommit modeShai Berger
The ticket was originally about two failing tests, which are fixed by putting their queries in transactions. Thanks Tim Graham for the report, Aymeric Augustin for the fix, and Simon Charette, Tim Graham & Loïc Bistuer for review.
2014-04-09Fixed #21553 -- Ensured unusable database connections get closed.Aymeric Augustin
2014-04-05Fixed #22236 -- Removed inappropriate usage of signalsClaude Paroz
Thanks Aymeric Augustin for the report and Tim Graham for the review.
2014-04-03Fixed #22363 -- Correctly serialize `django.utils.datetime_safe` objects.Simon Charette
Thanks to linovia for the report.