1
0
mirror of https://github.com/django/django.git synced 2025-01-15 04:45:51 +00:00

275 Commits

Author SHA1 Message Date
Mariusz Felisiak
ddbe5c86e8 [5.0.x] Fixed #34944 -- Made GeneratedField.output_field required.
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.

Backport of 5875f03ce61b85dfd9ad34f7b871c231c358d432 from main
2023-11-14 20:22:33 +01:00
Mariusz Felisiak
5b1d0a6be0 [5.0.x] Reverted "Refs #30446, Refs #34944 -- Fixed crash when adding GeneratedField with string Value()."
This reverts commit 8b1acc0440418ac8f45ba48e2dfcf5126c83341b.

Backport of de4884b114534f43c49cf8c5b7f10181e737f4e9 from main
2023-11-14 15:46:23 +01:00
Simon Charette
73869a5163 [5.0.x] Refs #30446, Refs #34944 -- Fixed crash when adding GeneratedField with string Value().
This should allow smarter output_field inferring in functions dealing
with text expressions.

Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.

Backport of 8b1acc0440418ac8f45ba48e2dfcf5126c83341b from main
2023-11-08 16:18:00 +03:00
Simon Charette
0265eaa500 [5.0.x] Fixed #34946 -- Preserved db_default on combined default field addition.
Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.
Backport of 8a28e983df091d94eaba77cb82fbe3ef60a80799 from main
2023-11-07 13:33:24 +03:00
Tom Carrick
602835202d [5.0.x] Fixed #34932 -- Restored varchar_pattern_ops/text_pattern_ops index creation when deterministic collaction is set.
Regression in f3f9d03edf17ccfa17263c7efa0b1350d1ac9278 (4.2) and
8ed25d65ea7546fafd808086fa07e7e5bb5428fc (5.0).

Backport of 34b411762b50883d768d7b67e0a158ec39da8b09 from main
2023-10-30 11:08:03 +01:00
Paolo Melchiorre
0f9d07398d [5.0.x] Fixed #34877 -- Fixed migrations crash when adding GeneratedField with output_field with params.
Backport of e7e8eb44a30bcab004a582760752b5eb3fcd6e91 from main
2023-09-28 08:12:39 +02:00
Paolo Melchiorre
81663cc4ca [5.0.x] Fixed #34861 -- Fixed crash when adding GeneratedField with some expressions.
Co-authored-by: Simon Charette <charette.s@gmail.com>

Backport of 574ee4023e15cfb195833edfbaed353f8021c62f from main
2023-09-22 21:37:01 +02:00
Mariusz Felisiak
2b582387d5
Fixed #34760 -- Dropped support for SQLite < 3.27. 2023-08-04 06:35:13 +02:00
Mariusz Felisiak
22b0b73c77
Fixed warnings per flake8 6.1.0. 2023-07-30 16:17:07 +02:00
Simon Charette
595a2abb58 Fixed #34701 -- Added support for NULLS [NOT] DISTINCT on PostgreSQL 15+. 2023-07-19 21:42:27 +02:00
Ian Foote
7414704e88 Fixed #470 -- Added support for database defaults on fields.
Special thanks to Hannes Ljungberg for finding multiple implementation
gaps.

Thanks also to Simon Charette, Adam Johnson, and Mariusz Felisiak for
reviews.
2023-05-12 19:11:40 +02:00
Petter Friberg
8ed25d65ea Fixed #34505 -- Skipped varchar_pattern_ops/text_pattern_ops index creation when db_collation is set in related field. 2023-04-21 10:31:22 +02:00
Mariusz Felisiak
765b96734c Added SchemaTests._add_ci_collation() hook. 2023-04-21 10:00:09 +02:00
Tim Graham
40e88ae8c8
Refs #34320 -- Added skipIf for a test requiring check constraints. 2023-02-24 06:00:00 +01:00
nabil-rady
6bdc3c58b6 Fixed #34320 -- Make sure constraints names are obtained from truncated columns names. 2023-02-15 16:51:31 +01:00
David Smith
097e3a70c1 Refs #33476 -- Applied Black's 2023 stable style.
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-02-01 11:04:38 +01:00
sag᠎e
110b3b8356
Fixed #34304 -- Made MySQL's SchemaEditor.remove_constraint() don't create foreign key index when unique constraint is ignored.
Regression in b731e8841558ee4caaba766c83f34ea9c7004f8b.
2023-01-31 11:52:07 +01:00
kimsoungryoul
78f163a4fb Fixed #18468 -- Added support for comments on columns and tables.
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-28 06:28:07 +01:00
Mariusz Felisiak
ae0899be0d
Fixed #34219 -- Preserved Char/TextField.db_collation when altering column type.
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-22 07:12:17 +01:00
Daniele Varrazzo
09ffc5c121 Fixed #33308 -- Added support for psycopg version 3.
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-12-15 06:17:57 +01:00
Mariusz Felisiak
7b0e9ea53c
Fixed #34138 -- Avoided table rebuild when adding inline m2m fields on SQLite.
Regression in 2f73e5406d54cb8945e187eff302a3a3373350be.

Thanks David Wobrock for the report.
2022-11-04 09:30:23 +01:00
Mariusz Felisiak
bc3b8f1524
Refs #34058 -- Fixed changing/deleting sequences when altering pre-Django 4.1 auto fields on PostgreSQL.
Thanks Anders Kaseorg for the report.

Follow up to 19e6efa50b603af325e7f62058364f278596758f.
Regression in 2eea361eff58dd98c409c5227064b901f41bd0d6.
2022-10-01 07:53:32 +02:00
Mariusz Felisiak
19e6efa50b
Fixed #34058 -- Changed sequence types when altering pre-Django 4.1 auto fields on PostgreSQL.
Thanks Anders Kaseorg for the report.

Thanks Florian Apolloner for pair programming.

Regression in 2eea361eff58dd98c409c5227064b901f41bd0d6.
2022-09-29 13:20:14 +02:00
Sergey Fursov
b731e88415 Fixed #31335 -- Fixed removing composed composed Meta constraints/indexes on foreign keys on MySQL. 2022-09-13 10:38:57 +02:00
Sergey Fursov
1b08e9bf7d Refs #31335 -- Added more tests for removing composed Meta constraints/indexes on foreign keys. 2022-09-12 13:52:06 +02:00
Benoît Vinot
e3cb8bcb7d Fixed #33932 -- Fixed altering AutoFields to OneToOneField on PostgreSQL.
Regression in 2eea361eff58dd98c409c5227064b901f41bd0d6.
2022-08-17 17:06:00 +02:00
Haolun Chai
f3f9d03edf Fixed #33901 -- Skipped varchar_pattern_ops/text_pattern_ops index creation when db_collation is set. 2022-08-15 06:28:35 +02:00
Mariusz Felisiak
5c803bc070
Fixed #33919 -- Fixed adding AutoFields on PostgreSQL.
Thanks Jack Calvin Brown for the report.

Regression in 2eea361eff58dd98c409c5227064b901f41bd0d6.
2022-08-12 17:30:23 +02:00
Fiza Ashraf
c0beff2123 Fixed #33899 -- Fixed migration crash when removing indexed field on SQLite 3.35.5+.
Regression in 702819227fd0cdd9b581cd99e11d1561d51cbeb.

Thanks cessor for the report.
2022-08-08 06:28:53 +02:00
Mariusz Felisiak
ab1955a05e
Fixed #33881 -- Added support for database collations to ArrayField(Char/TextFields). 2022-08-02 11:44:26 +02:00
David Wobrock
a6385b382e
Fixed #27236 -- Deprecated Meta.index_together in favor of Meta.indexes.
This also deprecates AlterIndexTogether migration operation.
2022-07-12 09:04:31 +02:00
David Wobrock
a3a1290d47 Refs #27236 -- Moved models with Meta.index_together inside of test methods. 2022-06-03 06:32:11 +02:00
David Wobrock
8f04473af1 Fixed #25105 -- Checked deferred constraints before updating rows on PostgreSQL. 2022-05-04 12:15:00 +02:00
Mariusz Felisiak
1b3a949ba2
Refs #33671 -- Fixed migrations crash when adding collation to a primary key on Oracle. 2022-04-29 21:43:55 +02:00
Mariusz Felisiak
b34238addc
Fixed #33670 -- Fixed altering primary key on SQLite. 2022-04-29 20:16:34 +02:00
Florian Apolloner
2eea361eff Fixed #30511 -- Used identity columns instead of serials on PostgreSQL. 2022-04-13 21:51:51 +02:00
Mariusz Felisiak
a65547c04a
Fixed tests on databases that don't support introspecting foreign keys. 2022-04-13 11:52:40 +02:00
Himanshu-Balasamanta
06ebaa9e28 Fixed #33626 -- Cleared cache when unregistering a lookup. 2022-04-12 06:24:02 +02:00
Mariusz Felisiak
bfe9665502
Skipped SchemaTests.test_alter_field_type_and_db_collation on databases that don't support collation on TextField. 2022-04-06 16:52:13 +02:00
sarahboyce
65effbdb10 Fixed #33471 -- Made AlterField operation a noop when changing "choices".
This also allows customizing attributes of fields that don't affect
a column definition.
2022-04-06 13:05:57 +02:00
Carlton Gibson
bb61f0186d Refs #32365 -- Removed internal uses of utils.timezone.utc alias.
Remaining test case ensures that uses of the alias are mapped
canonically by the migration writer.
2022-03-24 06:29:50 +01:00
likecodingloveproblems
4b66a5e617 Fixed #33256 -- Fixed schema test failures when using --keepdb. 2022-03-21 20:54:48 +01:00
Mariusz Felisiak
26c166c3b0
Added test for removing through model from ManyToManyField. 2022-02-25 22:01:27 +01:00
Mariusz Felisiak
3702819227
Refs #32502 -- Avoided table rebuild when removing fields on SQLite 3.35.5+.
ALTER TABLE ... DROP COLUMN was introduced in SQLite 3.35+ however
a data corruption issue was fixed in SQLite 3.35.5.
2022-02-11 22:21:58 +01:00
Mariusz Felisiak
7119f40c98 Refs #33476 -- Refactored code to strictly match 88 characters line length. 2022-02-07 20:37:05 +01:00
django-bot
9c19aff7c7 Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
Mariusz Felisiak
30613d6a74
Fixed #33408 -- Fixed adding nullable unique fields on SQLite.
Regression in 2f73e5406d54cb8945e187eff302a3a3373350be.

Thanks Alan Crosswell for the report.
2022-01-04 05:50:00 +01:00
mdalp
3b73f77ad4 Fixed #33358 -- Fixed handling timedelta < 1 day in schema operations on Oracle. 2021-12-14 09:08:25 +01:00
Mariusz Felisiak
2f73e5406d Refs #32502 -- Avoided table rebuild when adding fields with no default on SQLite. 2021-12-10 17:13:05 +01:00
Tim Graham
ddf321479b
Removed unneeded @skipUnlessDBFeature('supports_combined_alters').
The test acts a regression test for 715ccfde24f9f2b7f6710429370a1eff3c78fc2a
if the feature is True, but it works on other backends too.
2021-11-24 09:13:28 +01:00