The Needs Review Queue Bot β tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide β to find step-by-step guides for working with issues.
- π³π±Netherlands daffie
I think that we for PostgreSQL first need to remove the sequence, than change the field from an integer to a big integer field. After that is done can a new sequence be created. This can be done in the method changeField(). In that method we are already doing the same with constraints on the field. Just before removing the contraints on the field remove the sequence.
- Status changed to Needs review
almost 2 years ago 2:10pm 13 March 2023 - π³π±Netherlands arantxio Dordrecht
I've changed the varchar_acsii type to text, which seems to be working on my end.
- π³π±Netherlands arantxio Dordrecht
Changed the test with some help from @daffie, this should be a bit better to understand.
- Status changed to RTBC
almost 2 years ago 7:09pm 13 March 2023 - π³π±Netherlands daffie
All code changes look good to me.
All my remarks have been addressed.
I have updated the IS.
For me it is RTBC. - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
+++ b/core/modules/pgsql/src/Driver/Database/pgsql/Schema.php @@ -910,6 +909,14 @@ public function changeField($table, $field, $field_new, $spec, $new_keys = []) { + // We need to add CASCADE otherwise we cannot drop the sequence because + // the table depends on it.
Just for my understanding (I've not used postgres for about 15 years) can you elaborate on the type of objects that this will remove in Drupal?
Does the table gets removed? We don't do foreign keys so I assume it doesn't spider out to other tables.
- π³π±Netherlands daffie
@larowlan: The cascade option is necessary, because a sequence in PostgreSQL can have dependencies behind it like a constraint that the value cannot be lower then zero. When you delete the sequence, the constraint also needs to be deleted. The alternative is to delete the constraint first and then delete the sequence. The last option is more work and more that can go wrong.
The text in the comment is about the sequence is preventing the altering of the table. We should change the word "drop" to "alter" in the comment. Hopefully this can be done on commit. - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Thanks daffie that makes sense and resolves my concern, I'll look at this tomorrow morning
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
We're in commit freeze so I will wait for that to finish before committing, but this is top of my list
-
larowlan β
committed 251a9465 on 10.0.x
Issue #3191391 by Arantxio, larowlan, _utsavsharma, daffie: Schema::...
-
larowlan β
committed 251a9465 on 10.0.x
-
larowlan β
committed 6367bb87 on 10.1.x
Issue #3191391 by Arantxio, larowlan, _utsavsharma, daffie: Schema::...
-
larowlan β
committed 6367bb87 on 10.1.x
- Status changed to Downport
over 1 year ago 2:47am 28 March 2023 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Committed to 10.1.x and 10.0.x.
Needs reroll for backport to 9.5.x, the test changes don't apply.
- Status changed to Needs review
over 1 year ago 7:19pm 31 March 2023 - π¦π·Argentina dagmar Argentina
Rerolled for Drupal 9.5.x.
core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSchemaTestBase.php
has a lot of new lines in D10 than D9.5. I hope this doesn't break anything... - Status changed to Needs work
over 1 year ago 5:58pm 5 April 2023 - Status changed to Needs review
over 1 year ago 9:15am 11 April 2023 - π³π±Netherlands arantxio Dordrecht
Thanks @dagmar for the reroll. The function getPrefix, does not exist in D9.5, because this function replaces tablePrefix(). So in this case for Drupal 9.5 we need to revert back to using tablePrefix().
I could not create a interdiff unfortunately, but I only changed the function getPrefix to tablePrefix($table) in pgsql/Schema / getSequenceName()
- π¬π§United Kingdom alexpott πͺπΊπ
This issue relies on code from #3257201: Create the new method Drupal\Core\Database\Connection::getPrefix() and deprecate Drupal\Core\Database\Connection::prefixTable($table) β so we have to revert it from 10.0.x as that issue is only in 10.1.x.
-
alexpott β
committed 58268fcb on 10.0.x
Revert "Issue #3191391 by Arantxio, larowlan, _utsavsharma, daffie:...
-
alexpott β
committed 58268fcb on 10.0.x
- Status changed to Fixed
over 1 year ago 9:42am 11 April 2023 - π¬π§United Kingdom alexpott πͺπΊπ
On 10.0.x prior to the revert if you run
core/tests/Drupal/KernelTests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
you will get an error like:Error : Call to undefined method Drupal\pgsql\Driver\Database\pgsql\Connection::getPrefix() /Volumes/dev/sites/drupal8alt.dev/core/modules/pgsql/src/Driver/Database/pgsql/Schema.php:1086
Automatically closed - issue fixed for 2 weeks with no activity.