Commit Graph

242 Commits

Author SHA1 Message Date
Tim Graham 93d73dac91 Moved DatabaseCreation.data_types properties to DatabaseWrapper.
refs #22340.
2014-12-31 08:29:17 -05:00
Andriy Sokolovskiy 8c99b7920e Fixed #12118 -- Added shared cache support to SQLite in-memory testing. 2014-12-30 10:14:33 -05:00
Anssi Kääriäinen 227a4c48be Refs #2443 -- fixed format_dtdelta on SQLite
A test failed on Python 2 32-bit.
2014-12-23 07:05:44 -05:00
Marc Tamlyn 57554442fe Fixed #2443 -- Added DurationField.
A field for storing periods of time - modeled in Python by timedelta. It
is stored in the native interval data type on PostgreSQL and as a bigint
of microseconds on other backends.

Also includes significant changes to the internals of time related maths
in expressions, including the removal of DateModifierNode.

Thanks to Tim and Josh in particular for reviews.
2014-12-20 18:28:29 +00:00
Andriy Sokolovskiy 089047331d Fixed #23987 -- Made SQLite SchemaEditor always use effective_default(). 2014-12-15 13:40:24 -05:00
Josh Smeaton 267a1dcd9b Fixed #23941 -- Removed implicit decimal formatting from expressions. 2014-12-12 10:17:48 -05:00
Jon Dufresne 4468c08d70 Fixed #23968 -- Replaced list comprehension with generators and dict comprehension 2014-12-08 07:58:23 -05:00
Markus Holtermann d2202ec2d4 Fixed #23880 -- Added missing index_together handling for SQLite 2014-12-01 11:30:33 +07:00
Thomas Chaumeny 6b5d82749c Fixed #16731 -- Made pattern lookups work properly with F() expressions 2014-11-28 12:50:42 +02:00
Josh Smeaton f59fd15c49 Fixed #14030 -- Allowed annotations to accept all expressions 2014-11-15 14:00:43 +00:00
Tim Graham 92269b7b53 Fixed #23702 -- Fixed adding an explicit id field on SQLite.
Thanks gavinwahl for the report.
2014-10-23 12:24:34 -04:00
Markus Holtermann f633ba778d Fixed #23609 -- Fixed IntegrityError that prevented altering a NULL column into a NOT NULL one due to existing rows
Thanks to Simon Charette, Loic Bistuer and Tim Graham for the review.
2014-10-09 21:32:06 +07:00
Claude Paroz d1ca70110f Factorized schema_editor() at BaseDatabaseWrapper level 2014-09-26 08:50:16 +02:00
Claude Paroz b8cdc7dcc3 Made get_table_list return a TableInfo named tuple 2014-09-23 20:13:31 +02:00
Marc Tamlyn ed7821231b Fixed #19463 -- Added UUIDField
Uses native support in postgres, and char(32) on other backends.
2014-09-16 10:08:09 +01:00
Tim Graham 1101467ce0 Limited lines to 119 characters in django/
refs #23395.
2014-09-05 09:22:16 -04:00
Marc Tamlyn e9103402c0 Fixed #18757, #14462, #21565 -- Reworked database-python type conversions
Complete rework of translating data values from database

Deprecation of SubfieldBase, removal of resolve_columns and
convert_values in favour of a more general converter based approach and
public API Field.from_db_value(). Now works seamlessly with aggregation,
.values() and raw queries.

Thanks to akaariai in particular for extensive advice and inspiration,
also to shaib, manfre and timograham for their reviews.
2014-09-03 20:36:03 +01:00
Florian Apolloner 61d783f3d7 Made sqlite's remove_field behave like the base backend. 2014-08-10 13:31:06 +02:00
Alex Hill 938da36cb1 Fixed #21603 -- Fixed complex RawQuerySets queries on some versions of SQLite. 2014-08-06 08:41:34 -04:00
Mihail Milushev bf5382c6e5 Fixed #22234 -- Replaced OS-specific code with subprocess.call() in dbshell.
This fixes escaping of special characters on Windows.
2014-08-04 09:21:03 -04:00
Aymeric Augustin 729e4ae4f0 Fixed #23074 -- Avoided leaking savepoints in atomic.
Thanks Chow Loong Jin for the report and the initial patch.
2014-07-28 14:30:41 +02:00
Claude Paroz 8c30df15f1 Fixed #23030 -- Properly handled geometry columns metadata during migrations
Thanks kunitoki for the report and initial patches.
2014-07-23 12:10:23 +02:00
Andrew Godwin e24e9e0438 Fixed #23014: Renaming not atomic with unique together 2014-07-21 11:36:34 +01:00
Tim Graham 82c935d44c Renamed DatabaseFeature.supports_check_constraints to supports_column_check_constraints.
Thanks maxi for the suggestion.
2014-06-16 19:25:13 -04:00
Andrew Godwin c8c79367a2 Fixed #22844: Duplicate SQL for SQLite FKs 2014-06-16 00:27:32 -07:00
Aymeric Augustin e071f67b7f Replaced an explicit vendor check by a feature flag.
Forward-port of c9aedce0 from stable/1.7.x.
2014-06-06 00:32:13 +02:00
Claude Paroz 5a504a5311 Fixed #22744 -- Fixed sqlite3 get_relations introspection with views
Thanks Tim Graham for the report and Simon Charette for the review.
2014-06-01 22:03:33 +02:00
Greg Chapple b7aa7c4ab4 Fixed #20550 -- Added ability to preserve test db between runs 2014-05-28 16:22:46 +01:00
Andrew Godwin 03900a02d5 Fixed #22432: SQLite M2M repointing now works. Thanks to xelnor. 2014-05-20 16:25:59 +01:00
Andrew Godwin 125b3d4407 Fixed #22649: Beefed up quote_value 2014-05-20 15:41:01 +01:00
Raphaël Barrois 6aacb4c991 Fixed #22626 -- Allow BinaryField defaults with SQlite.
Also fixes a slight issue in sqlite3.schema._remake_table where
default values where quoted with "column name" quoting rules.

Reference for quoting: http://www.sqlite.org/lang_expr.html

Thanks Shai Berger for the review. Refs #22424.
2014-05-17 22:32:17 +07:00
Aymeric Augustin 99d9fa329a Added feature flags for introspection capabilities. 2014-05-08 22:11:20 +02:00
Andrew Godwin b25aee3b7b Fixed #22476: Couldn't alter attributes on M2Ms with through= set 2014-05-08 10:34:24 -07:00
Andrew Godwin e9a456d11b Fixed #22581: Pass default values for schema through get_db_prep_save() 2014-05-07 13:46:23 -07:00
Aymeric Augustin e368912902 Set some transaction-related feature flags on SQLite.
Refs #22496.
2014-04-25 11:43:20 +02:00
Andrew Gorcester 956bd64424 Fixed #22397 -- Issues removing M2M field with explicit through model
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-18 16:44:47 -04:00
Simon Charette 0d397e5a5b Revert "Fixed #22397 -- Issues removing M2M field with explicit through model."
This reverts commit 00e3b9a2a9.

It's causing a regression when tested with the proxy_model_inheritance tests.
2014-04-18 01:27:30 -04:00
Andrew Gorcester 00e3b9a2a9 Fixed #22397 -- Issues removing M2M field with explicit through model.
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-17 12:54:35 -04:00
Aymeric Augustin 3becac8484 Fixed #22321 -- Wrapped exceptions in _set_autocommit.
Refs #21202.
2014-04-10 20:16:12 +02:00
Loic Bistuer a449e7feec Fixed #22359 -- Changing M2M field to blank=True failed on sqlite. 2014-03-31 06:13:19 -04:00
Simon Charette 1506c71a95 Fixed #12030 -- Validate integer field range at the model level.
Thanks to @timgraham for the review.
2014-03-25 14:31:20 -04:00
Daniel Hahler 1edfa155e3 Fixed #22293 -- Avoided renaming many-to-many tables to themselves.
Fixed this for both implementations of _alter_many_to_many, instead of
in `alter_db_table` itself (more implementations).
2014-03-24 13:24:52 -04:00
Chris Beaven b47ef04ea2 Fix any sqlite field migration deleting all implicit m2m tables
Fixes #22281
2014-03-18 16:54:35 +13:00
Shai Berger 41afae4ce9 Reorganized the database test settings
Change database test settings from "TEST_"-prefixed entries in the
database settings dictionary to setting in a dictionary that is itself
an entry "TEST" in the database settings.

Refs #21775

Thanks Josh Smeaton for review.
2014-03-09 03:57:18 +02:00
Baptiste Mispelon c679cb7f60 Fixed #22168 -- Fixed migrations failing on sqlite when column names are SQL keywords
Thanks to trac user fallen_flint for the report and initial patch.
2014-03-01 13:45:45 +01:00
Andrew Godwin 42607a9e33 Fixed #21844: Move quote_parameter off of Operations and rename 2014-02-09 12:42:26 +00:00
Andrew Godwin a7e2957110 Fixed #21917: Overly cautious SQLite3 backend for null fields + defaults 2014-02-09 11:10:21 +00:00
Michael Manfre 3ffeb93186 Ensure cursors are closed when no longer needed.
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-02-02 12:47:21 -05:00
Andrew Godwin 2a30b39f40 Fixed #21783: More SQLite default fun with nulls. 2014-01-25 00:10:25 +00:00
Andrew Godwin e802c97581 Fixed #21783: Use defaults for adding NOT NULL on sqlite 2014-01-19 17:10:24 +00:00