summaryrefslogtreecommitdiff
path: root/tests/schema
AgeCommit message (Collapse)Author
2020-07-22[3.1.x] Fixed #31805 -- Fixed SchemaTests.tearDown() when table names are ↵Mariusz Felisiak
case-insensitive. Backport of fd53db842c35c994dbd54196dd38a908f3676b1a from master
2020-07-22[3.1.x] Fixed #31797 -- Skipped schema tests on specific MariaDB versions.Mariusz Felisiak
test_alter_not_unique_field_to_primary_key() test is affected by https://jira.mariadb.org/browse/MDEV-19598 on MariaDB 10.4.4 to 10.5.1. test_alter_pk_with_self_referential_field() test is affected by https://jira.mariadb.org/browse/MDEV-22775 on MariaDB 10.4 series from 10.4.13. Backport of c071c408d72330b422c124a6bdd85a68acae9566 from master
2020-06-24[3.1.x] Fixed #31735 -- Fixed migrations crash on namespaced inline FK ↵Simon Charette
addition on PostgreSQL. The namespace of the constraint must be included when making the constraint immediate. Regression in 22ce5d0031bd795ade081394043833e82046016c. Thanks Rodrigo Estevao for the report. Backport of 2e8941b6f90e65ffad3f07083b8de59e8ed29767 from master
2020-03-23Added missing Meta.apps to a schema model.Tim Graham
2020-02-20Corrected typo in test docstring.Jon Dufresne
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2019-12-23Fixed #31106 -- Fixed migrations crash on PostgreSQL 10+ when adding FK ↵Mariusz Felisiak
constraints inline and changing data. This allows adding foreign key constraints inline and changing data in the same migration on PostgreSQL 10+. Regression in 738faf9da2a5cd03148a36375db80746c99c9623. Thanks Janne Rönkkö for the report and Simon Charette for the implementation idea and review.
2019-10-29Used more specific unittest assertions in tests.Nick Pope
* assertIsNone()/assertIsNotNone() instead of comparing to None. * assertLess() for < comparisons. * assertIs() for 'is' expressions. * assertIsInstance() for isinstance() expressions. * rounding of assertAlmostEqual() for round() expressions. * assertIs(..., True/False) instead of comparing to True/False. * assertIs()/assertIsNot() for ==/!= comparisons. * assertNotEqual() for == comparisons. * assertTrue()/assertFalse() instead of comparing to True/False.
2019-10-17Refs #28816 -- Prevented silencing data loss when decreasing ↵Hasan Ramezani
CharField.max_length for ArrayField.base_field on PostgreSQL.
2019-09-25Fixed #30800 -- Fixed migrations crash when altering a field with custom ↵Mariusz Felisiak
db_type(). Regression in 1378d665a1c85897d951f2ca9618b848fdbba2e7.
2019-09-11Refs #27338 -- Added tests for altering CharField with primary_key=True to ↵Mariusz Felisiak
AutoField on PostgreSQL. Fixed in 91b2bc3e70be2632baad86488fb03cf02848b5b6.
2019-09-05Made SchemaTests.test_alter_db_table_case run only on backends where table ↵Hasan Ramezani
names are case-insensitive.
2019-08-23Fixed typos in test names and a comment.Min ho Kim
2019-08-02Fixed #30661 -- Added models.SmallAutoField.Nick Pope
2019-08-01Refs #30664 -- Fixed migrations crash when altering AutoField/BigAutoField ↵Mariusz Felisiak
with quoted db_column on PostgreSQL.
2019-08-01Fixed #30664 -- Fixed migrations crash when altering table on SQLite or ↵Ngalim Siregar
altering AutoField/BigAutoField on PostgreSQL for models with quoted db_table.
2019-07-19Fixed #30593 -- Added support for check constraints on MariaDB 10.2+.Hasan Ramezani
2019-07-08Changed django.db.models.indexes.Index imports to django.db.models.Index.Mariusz Felisiak
2019-05-21Fixed #28816 -- Prevented silencing data loss when decreasing ↵Hasan Ramezani
CharField.max_length on PostgreSQL.
2019-04-08Fixed #30266 -- Kept a sequence owner when altering an ↵Dolan Antenucci
AutoField/BigAutoField on PostgreSQL.
2019-03-17Refs #30172 -- Prevented removing a model Meta's index/unique_together from ↵Paveł Tyślacki
removing Meta constraints/indexes.
2019-03-17Refs #30172 -- Prevented removing a field's check or unique constraint from ↵Paveł Tyślacki
removing Meta constraints.
2019-03-13Fixed #30183 -- Added introspection of inline SQLite constraints.Paveł Tyślacki
2019-01-29Fixed #30108 -- Allowed adding foreign key constraints in the same statement ↵Dan Tao
that adds a field.
2019-01-01Fixed #30060 -- Moved SQL generation for indexes and constraints to ↵Paveł Tyślacki
SchemaEditor.
2018-12-26Refs #30033 -- Fixed schema's test_m2m_rename_field_in_target_model test ↵Tim Graham
failure on SQLite < 3.20. Mixing local test models with non-local models resulted in a referential integrity error during tear down since the models are removed in separate schema editor instances which each check constraints. Failure appeared after 7289874adceec46b5367ec3157cdd10c711253a0.
2018-11-21Fixed #29949 -- Refactored db introspection identifier converters.Mariusz Felisiak
Removed DatabaseIntrospection.table_name_converter()/column_name_converter() and use instead DatabaseIntrospection.identifier_converter(). Removed DatabaseFeatures.uppercases_column_names. Thanks Tim Graham for the initial patch and review and Simon Charette for the review.
2018-11-13Refs #29641 -- Refactored database schema constraint creation.Simon Charette
Added a test for constraint names in the database. Updated SQLite introspection to use sqlparse to allow reading the constraint name for table check and unique constraints. Co-authored-by: Ian Foote <python@ian.feete.org>
2018-10-29Fixed #29547 -- Added support for partial indexes.Mads Jensen
Thanks to Ian Foote, Mariusz Felisiak, Simon Charettes, and Markus Holtermann for comments and feedback.
2018-09-25Fixed #29778 -- Fixed quoting of unique index names.Oleg
Regression in 3b429c96736b8328c40e5d77282b0d30de563c3c.
2018-06-17Fixed #29496 -- Fixed crash on Oracle when converting a non-unique field to ↵Mariusz Felisiak
primary key. Thanks Tim Graham for the review.
2018-05-07Replaced django.test.utils.patch_logger() with assertLogs().Claude Paroz
Thanks Tim Graham for the review.
2018-04-12Fixed schema test failure when running tests in reverse.Tim Graham
Follow up to 003334f8af29e2023cf7ad7d080aa9ab26a7c528.
2018-04-11Fixed #29193 -- Prevented unnecessary foreign key drops when altering a ↵Jeremy Bowman
unique field. Stopped dropping and recreating foreign key constraints on other fields in the same table as the one which is actually being altered in an AlterField operation. Regression in c3e0adcad8d8ba94b33cabd137056166ed36dae0.
2018-04-11Tested altering a unique field when a reverse M2M relation exists.Jeremy Bowman
2018-03-20Refs #29227 -- Made inspectdb generate BooleanField(null=True) rather than ↵Tim Graham
NullBooleanField.
2018-03-17Fixed #29103 -- Removed bad 'b'-prefix added by MySQL's ↵Claude Paroz
SchemaEditor.quote_value().
2018-03-14Moved SchemaLoggingTest to tests/schema.Tim Graham
2018-01-13Fixed #28542 -- Fixed deletion of primary key constraint if the new field is ↵Tim Martin
unique.
2018-01-02Refs #28930 -- Simplified schemas test with any().Tim Graham
2017-12-22Fixed #28884 -- Fixed crash on SQLite when renaming a field in a model ↵Simon Charette
referenced by a ManyToManyField. Introspected database constraints instead of relying on _meta.related_objects to determine whether or not a table or a column is referenced on rename operations. This has the side effect of ignoring both db_constraint=False and virtual fields such as GenericRelation which aren't backend by database level constraints and thus shouldn't prevent the rename operations from being performed in a transaction. Regression in 095c1aaa898bed40568009db836aa8434f1b983d. Thanks Tim for the additional tests and edits, and Mariusz for the review.
2017-12-06Fixed #28893 -- Removed unnecessary dict.items() calls.Tim Graham
2017-12-05Refs #28876 -- Fixed incorrect foreign key constraint name for models with ↵Mariusz Felisiak
quoted db_table. Thanks Simon Charette and Tim Graham for the review and Carlos E. C. Leite for the report.
2017-12-01Fixed #28849 -- Fixed referenced table and column rename on SQLite.Simon Charette
Thanks Ramiro for the input and Tim for the review.
2017-11-14Fixed #28792 -- Fixed index name truncation of namespaced tables.Simon Charette
Refs #27458, #27843. Thanks Tim and Mariusz for the review.
2017-09-25Fixed #28552 -- Dropped support for MySQL 5.5.Tim Graham
2017-09-06Refs #23919 -- Replaced usage of django.utils.functional.curry() with ↵Sergey Fedoseev
functools.partial()/partialmethod().
2017-07-11Fixed #14204 -- Enforced SQLite foreign key constraints.Claude Paroz
Thanks Tim Graham for contributing to the patch and Simon Charette for advice and review.
2017-06-22Fixed #28298 -- Prevented a primary key alteration from adding a foreign key ↵Josh Schneier
constraint if db_constraint=False.
2017-06-21Refs #25530 -- Deleted deferred SQL references on delete operation.Simon Charette