Commit Graph

105 Commits

Author SHA1 Message Date
Jon Dufresne 16614dcd5c Fixed #25694 -- Removed incorrect _uniq suffix on index names during migrations. 2016-06-29 14:47:29 -04:00
Jon Dufresne d47f6d75ef Refs #26034 -- Corrected a schema test to work with the correct field state. 2016-06-27 12:13:15 -04:00
Akshesh 156e2d59cf Fixed #26709 -- Added class-based indexes.
Added the AddIndex and RemoveIndex operations to use them in migrations.

Thanks markush, mjtamlyn, timgraham, and charettes for review and advice.
2016-06-27 10:41:01 -04:00
Simon Charette c2e62fd1ae Fixed #26781 -- Made table name case change a noop on SQLite.
SQLite disgresses from the SQL standard by ignoring case of quoted identifiers.

Thanks to laozzzi for the report and Tim for the review.
2016-06-21 16:37:06 -04:00
Jon Dufresne 4f336f6652 Fixed #26747 -- Used more specific assertions in the Django test suite. 2016-06-16 14:19:18 -04:00
Iacopo Spalletti 49c57f8565 Fixed #25005 -- Made date and time fields with auto_now/auto_now_add use effective default.
Thanks to Andriy Sokolovskiy for initial patch.
2016-05-09 07:48:40 -04:00
Markus Holtermann deeffde84a Fixed #26593 -- Leveraged deferrable_sql() in SchemaEditor 2016-05-07 01:21:00 +02:00
Ville Skyttä 575a9a791e Normalized "an SQL" spelling. 2016-05-03 19:30:48 -04:00
Michal Petrucha d81d02d449 Refs #26384, #24995 -- Avoided a module-level MySQL query in the schema tests. 2016-04-02 08:17:35 -04:00
Tim Graham f3595b2549 Refs #26384, #24995 -- Skipped a schema test on older MySQL versions. 2016-03-31 12:00:25 -04:00
Alex Hill 4b2cf1cd27 Fixed #26384 -- Fixed renaming the PK on a model with a self-referential FK on SQLite. 2016-03-29 13:25:09 -04:00
Hasan 3d0dcd7f5a Refs #26022 -- Used context manager version of assertRaises in tests. 2016-01-29 12:32:18 -05:00
Tim Graham b49cc86643 Fixed #26116 -- Corrected schema's test_alter_implicit_id_to_explicit.
AUTOINCREMENT is dropped converting an AutoField to IntegerField
which isn't the point of this test. MySQL would warn or error about
this.
2016-01-22 12:46:27 -05:00
Tim Graham 56aaae58a7 Fixed #26034 -- Fixed incorrect index handling on PostgreSQL on Char/TextField with unique=True and db_index=True.
Thanks Simon Charette for review.
2016-01-08 12:47:05 -05:00
Tim Graham 54d3ba8406 Added a helper function in schema tests. 2016-01-08 12:39:06 -05:00
Federico Frenguelli 3a36c80795 Fixed #25412 -- Fixed missing PostgreSQL index on Char/TextField when using AlterField.
Thanks to Emanuele Palazzetti for the help.
2015-12-10 16:12:51 -05:00
Simon Charette 64240263f2 Refs #25745 -- Avoided multiple registration of the same model in schema tests. 2015-11-14 11:33:28 -05:00
Tim Graham 4dcc2a1955 Used SchemaEditor.delete_model() for teardown in schema tests.
Some third-party database backends (MSSQL) have custom
delete_model() requirements that must be executed.

Thanks Michael Manfre for the initial patch and review.
2015-10-16 08:40:57 -07:00
Simon Charette 8e8c0792c0 Refs #18081 -- Asserted db constraints are created for fk to proxy models. 2015-09-23 14:59:05 -04:00
Ville Skyttä 4d933ad418 Fixed #25393 -- Fixed MySQL crash when adding text/blob field with unhashable default. 2015-09-14 12:25:08 -04:00
Dražen Odobašić b1e33ceced Fixed #23395 -- Limited line lengths to 119 characters. 2015-09-12 11:40:50 -04:00
Simon Charette 12f91f6ebd Used skipUnlessDBFeature where appropriate. 2015-08-08 11:27:06 -04:00
Flavio Curella c2e70f0265 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 2015-07-27 18:28:13 -04:00
Tim Graham c52822e750 Fixed #25128 -- Fixed SQLite SchemaEditor crash when adding a ForeignObject field. 2015-07-15 15:22:52 -04:00
Simon Charette bdb382b2a4 Refs #25002 -- Supported textual to temporal column alteration on Oracle.
Thanks to Tim Graham for the report and Shai Berger for the review.
2015-06-24 19:37:55 -04:00
Simon Charette 73040e584a Fixed #25002 -- Used PostgreSQL column type alteration USING clause.
Thanks to Dirk Uys for the report.
2015-06-22 09:35:35 -04:00
Adam Brenecki 65296b3be3 Fixed #24972 -- Fixed removing unique_together indexes on MySQL. 2015-06-15 17:28:13 -04:00
Tim Graham 7c637a3aae Applied db_table conversion to fix schema tests on Oracle. 2015-06-02 19:17:17 -04:00
Tim Graham e1e6399c2c Fixed #24893 -- Fixed lack of unique constraint when changing a field from primary_key=True to unique=True 2015-06-02 09:25:47 -04:00
Tim Graham 5ab8680983 Fixed #24892 -- Fixed quoting of SQL when renaming a field to AutoField in PostgreSQL 2015-06-02 09:13:55 -04:00
Adam Chainz e60cce4e40 Fixed #24846 -- Added support to MySQL SchemaEditor for all blob/text data types 2015-05-30 20:37:57 -04:00
Andriy Sokolovskiy 80ad5472ce Fixed #24817 -- Prevented loss of null info in MySQL field renaming. 2015-05-28 10:07:52 -04:00
Tim Graham f5da438072 Fixed #24812 -- Fixed app registry RuntimeWarnings in schema and migrations tests. 2015-05-18 09:48:25 -04:00
Claude Paroz ae635cc365 Fixed #24757 -- Recreated MySQL index when needed during combined index removal
Thanks Thomas Recouvreux for the report and Tim Graham for the tests and
review.
2015-05-15 17:07:14 +02:00
Shai Berger d5a0accaa0 Fixed #24595 Oracle test failure
The only problem for Oracle was the test, which tested nullity on
text/char fields -- but Oracle interprets_empty_strings_as_null.
2015-04-18 18:52:30 +03:00
Claude Paroz 02260ea3f6 Fixed #24595 -- Prevented loss of null info in MySQL field alteration
Thanks Simon Percivall for the report, and Simon Charette and Tim
Graham for the reviews.
2015-04-17 10:25:15 +02:00
Anssi Kääriäinen 8f30556329 Renamed Field.rel attribute to remote_field
Field.rel is now deprecated. Rel objects have now also remote_field
attribute. This means that self == self.remote_field.remote_field.

In addition, made the Rel objects a bit more like Field objects. Still,
marked ManyToManyFields as null=True.
2015-03-25 08:16:12 -04:00
Jean-Louis Fuchs f4f0060fea Fixed #24447 -- Made migrations add FK constraints for existing columns
When altering from e.g. an IntegerField to a ForeignKey, Django didn't
add a constraint.
2015-03-07 14:09:56 +01:00
Shai Berger ceadc94f09 Fixed #24307: Avoided redundant column nullability modifications on Oracle
Thanks Joris Benschop for the report, and Tim Graham for the tests.
2015-02-19 02:39:41 +02:00
Tim Graham 0ed7d15563 Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
Markus Holtermann 235124d3ea Fixed small regression caused by 0204714b0b
Since 1.7 models need to declare an explicit app_label if they are not
in an application in INSTALLED_APPS or were imported before their
application was loaded.
2015-02-06 00:45:07 +01:00
Markus Holtermann 0204714b0b Cleaned up schema tests
Thanks Tim Graham for the review.
2015-02-05 20:11:48 +01:00
Tim Graham 75303b01a9 Fixed #24245 -- Added introspection for database defaults.
Needed for tests for migrations handling of database defaults.
2015-01-31 12:33:11 -05:00
Andriy Sokolovskiy 38c17871bb Fixed #24104 -- Fixed check to look on field.many_to_many instead of class instance 2015-01-22 18:41:19 +01:00
Markus Holtermann 64ecb3f07d Refs #24163 -- Fixed failing Oracle test when migrating from ForeignKey to OneToOneField
Thanks Tim Graham for review
2015-01-20 16:19:11 +01:00
Markus Holtermann 5792e6a88c Fixed #24163 -- Removed unique constraint after index on MySQL
Thanks Łukasz Harasimowicz for the report.
2015-01-19 16:52:26 +01:00
Daniel Pyrathon fb48eb0581 Fixed #12663 -- Formalized the Model._meta API for retrieving fields.
Thanks to Russell Keith-Magee for mentoring this Google Summer of
Code 2014 project and everyone else who helped with the patch!
2015-01-06 19:25:12 -05:00
Tim Graham ab4f709da4 Fixed #23581 -- Prevented extraneous DROP DEFAULT statements.
Thanks john_scott for the report and Markus Holtermann for review.
2014-12-30 07:54:05 -05:00
Tim Graham ac5f2a4ef7 Fixed refs #23987 test on Oracle. 2014-12-15 18:15:55 -05:00
Andriy Sokolovskiy 089047331d Fixed #23987 -- Made SQLite SchemaEditor always use effective_default(). 2014-12-15 13:40:24 -05:00