summaryrefslogtreecommitdiff
path: root/tests/schema
AgeCommit message (Collapse)Author
2024-10-31Fixed #35180 -- Recreated PostgreSQL _like indexes when changing between ↵Ben Cail
TextField and CharField field types.
2024-09-03Added assertion for the results of migrating an integer pk to SmallAutoField.Tim Graham
Follow up to 7ca42974ee087a82b6f7f6874ca2b25e42a9a584 which did the same for similar tests.
2024-08-01Reverted "Fixed #28646 -- Prevented duplicate index when unique is set to ↵Sarah Boyce
True on PostgreSQL." This reverts commit 9cf9c796be8dd53bc3b11355ff39d65c81d7be6d due to a crash on Oracle as it didn't allow multiple indexes on the same field.
2024-07-30Fixed #28646 -- Prevented duplicate index when unique is set to True on ↵Ben Cail
PostgreSQL.
2024-04-16Fixed #35373 -- Fixed a crash when indexing a generated field on SQLite.Simon Charette
Generated fields have to be excluded from the INSERT query against the remade table including the index. Thanks Moshe Dicker for the report, David Sanders and Mariusz Felisiak for the review.
2024-04-12Refs #35194 -- Adjusted a generated field test to work on Postgres 15.6+.Simon Charette
Postgres >= 12.18, 13.14, 14.11, 15.6, 16.2 changed the way the immutability of generated and default expressions is detected in postgres/postgres@743ddaf. The adjusted test semantic is presereved by switching from __icontains to __contains as both make use of a `%` literal which requires proper escaping. Refs #35336. Thanks bcail for the report.
2024-04-02Fixed #35336 -- Addressed crash when adding a GeneratedField with % literals.Simon Charette
A longer term solution is likely to have a better separation of parametrized DDL altogether to handle checks, constraints, defaults, and generated fields but such a change would require a significant refactor that isn't suitable for a backport. Thanks Adrian Garcia for the report.
2024-03-26Fixed #35329 -- Fixed migrations crash when adding partial unique ↵Mariusz Felisiak
constraints with nulls_distinct. Bug in 595a2abb58e04caa4d55fb2589bb80fb2a8fdfa1. Thanks Lucas Lemke Saunitti for the report.
2024-03-01Refs #35234 -- Deprecated CheckConstraint.check in favor of .condition.Simon Charette
Once the deprecation period ends CheckConstraint.check() can become the documented method that performs system checks for BaseConstraint subclasses.
2024-02-15Fixed #34060 -- Fixed migrations crash when adding check constraints with ↵Albert Defler
JSONField __exact lookup on Oracle.
2024-02-04Fixed #35149 -- Fixed crashes of db_default with unresolvable output field.Simon Charette
Field.db_default accepts either literal Python values or compilables (as_sql) and wrap the former ones in Value internally. While 1e38f11 added support for automatic resolving of output fields for types such as str, int, float, and other unambigous ones it's cannot do so for all types such as dict or even contrib.postgres and contrib.gis primitives. When a literal, non-compilable, value is provided it likely make the most sense to bind its output field to the field its attached to avoid forcing the user to provide an explicit `Value(output_field)`. Thanks David Sanders for the report.
2024-02-04Refs #35149 -- Made equivalent db_default alterations noops.Simon Charette
This allows for an easier transition of preserving the literal nature of non-compilable db_default.
2024-02-03Fixed #35162 -- Fixed crash when adding fields with db_default on MySQL.Simon Charette
MySQL doesn't allow literal DEFAULT values to be used for BLOB, TEXT, GEOMETRY or JSON columns and requires expression to be used instead. Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2023-12-14Refs #32503 -- Added assertion for effective default value when altering ↵Tobias Krönke
TextField to non-nullable with default.
2023-12-12Fixed #35018 -- Fixed migrations crash on GeneratedField with BooleanField ↵Mariusz Felisiak
as output_field on Oracle < 23c. Thanks Václav Řehák for the report. Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
2023-12-03Fixed #35002 -- Made UniqueConstraints with fields respect nulls_distinct.Peter Thomassen
Regression in 595a2abb58e04caa4d55fb2589bb80fb2a8fdfa1.
2023-11-30Fixed #35006 -- Fixed migrations crash when altering Meta.db_table_comment ↵Mariusz Felisiak
on SQLite. Thanks Юрий for the report. Regression in 78f163a4fb3937aca2e71786fbdd51a0ef39629e.
2023-11-14Fixed #34944 -- Made GeneratedField.output_field required.Mariusz Felisiak
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
2023-11-14Reverted "Refs #30446, Refs #34944 -- Fixed crash when adding GeneratedField ↵Mariusz Felisiak
with string Value()." This reverts commit 8b1acc0440418ac8f45ba48e2dfcf5126c83341b.
2023-11-08Refs #30446, Refs #34944 -- Fixed crash when adding GeneratedField with ↵Simon Charette
string Value(). This should allow smarter output_field inferring in functions dealing with text expressions. Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
2023-11-07Fixed #34946 -- Preserved db_default on combined default field addition.Simon Charette
Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.
2023-10-30Fixed #34932 -- Restored varchar_pattern_ops/text_pattern_ops index creation ↵Tom Carrick
when deterministic collaction is set. Regression in f3f9d03edf17ccfa17263c7efa0b1350d1ac9278 (4.2) and 8ed25d65ea7546fafd808086fa07e7e5bb5428fc (5.0).
2023-09-28Fixed #34877 -- Fixed migrations crash when adding GeneratedField with ↵Paolo Melchiorre
output_field with params.
2023-09-22Fixed #34861 -- Fixed crash when adding GeneratedField with some expressions.Paolo Melchiorre
Co-authored-by: Simon Charette <charette.s@gmail.com>
2023-09-18Refs #27236 -- Removed Meta.index_together per deprecation timeline.Mariusz Felisiak
2023-08-04Fixed #34760 -- Dropped support for SQLite < 3.27.Mariusz Felisiak
2023-07-30Fixed warnings per flake8 6.1.0.Mariusz Felisiak
2023-07-19Fixed #34701 -- Added support for NULLS [NOT] DISTINCT on PostgreSQL 15+.Simon Charette
2023-05-12Fixed #470 -- Added support for database defaults on fields.Ian Foote
Special thanks to Hannes Ljungberg for finding multiple implementation gaps. Thanks also to Simon Charette, Adam Johnson, and Mariusz Felisiak for reviews.
2023-04-21Fixed #34505 -- Skipped varchar_pattern_ops/text_pattern_ops index creation ↵Petter Friberg
when db_collation is set in related field.
2023-04-21Added SchemaTests._add_ci_collation() hook.Mariusz Felisiak
2023-02-24Refs #34320 -- Added skipIf for a test requiring check constraints.Tim Graham
2023-02-15Fixed #34320 -- Make sure constraints names are obtained from truncated ↵nabil-rady
columns names.
2023-02-01Refs #33476 -- Applied Black's 2023 stable style.David Smith
Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
2023-01-31Fixed #34304 -- Made MySQL's SchemaEditor.remove_constraint() don't create ↵sag᠎e
foreign key index when unique constraint is ignored. Regression in b731e8841558ee4caaba766c83f34ea9c7004f8b.
2022-12-28Fixed #18468 -- Added support for comments on columns and tables.kimsoungryoul
Thanks Jared Chung, Tom Carrick, David Smith, Nick Pope, and Mariusz Felisiak for reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2022-12-22Fixed #34219 -- Preserved Char/TextField.db_collation when altering column type.Mariusz Felisiak
This moves setting a database collation to the column type alteration as both must be set at the same time. This should also avoid another layer of the column type alteration when adding database comments support (#18468).
2022-12-15Fixed #33308 -- Added support for psycopg version 3.Daniele Varrazzo
Thanks Simon Charette, Tim Graham, and Adam Johnson for reviews. Co-authored-by: Florian Apolloner <florian@apolloner.eu> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-11-04Fixed #34138 -- Avoided table rebuild when adding inline m2m fields on SQLite.Mariusz Felisiak
Regression in 2f73e5406d54cb8945e187eff302a3a3373350be. Thanks David Wobrock for the report.
2022-10-01Refs #34058 -- Fixed changing/deleting sequences when altering pre-Django ↵Mariusz Felisiak
4.1 auto fields on PostgreSQL. Thanks Anders Kaseorg for the report. Follow up to 19e6efa50b603af325e7f62058364f278596758f. Regression in 2eea361eff58dd98c409c5227064b901f41bd0d6.
2022-09-29Fixed #34058 -- Changed sequence types when altering pre-Django 4.1 auto ↵Mariusz Felisiak
fields on PostgreSQL. Thanks Anders Kaseorg for the report. Thanks Florian Apolloner for pair programming. Regression in 2eea361eff58dd98c409c5227064b901f41bd0d6.
2022-09-13Fixed #31335 -- Fixed removing composed composed Meta constraints/indexes on ↵Sergey Fursov
foreign keys on MySQL.
2022-09-12Refs #31335 -- Added more tests for removing composed Meta ↵Sergey Fursov
constraints/indexes on foreign keys.
2022-08-17Fixed #33932 -- Fixed altering AutoFields to OneToOneField on PostgreSQL.Benoît Vinot
Regression in 2eea361eff58dd98c409c5227064b901f41bd0d6.
2022-08-15Fixed #33901 -- Skipped varchar_pattern_ops/text_pattern_ops index creation ↵Haolun Chai
when db_collation is set.
2022-08-12Fixed #33919 -- Fixed adding AutoFields on PostgreSQL.Mariusz Felisiak
Thanks Jack Calvin Brown for the report. Regression in 2eea361eff58dd98c409c5227064b901f41bd0d6.
2022-08-08Fixed #33899 -- Fixed migration crash when removing indexed field on SQLite ↵Fiza Ashraf
3.35.5+. Regression in 702819227fd0cdd9b581cd99e11d1561d51cbeb. Thanks cessor for the report.
2022-08-02Fixed #33881 -- Added support for database collations to ↵Mariusz Felisiak
ArrayField(Char/TextFields).
2022-07-12Fixed #27236 -- Deprecated Meta.index_together in favor of Meta.indexes.David Wobrock
This also deprecates AlterIndexTogether migration operation.