Problem/Motivation
The sequences table has been deprecated and will be removed in Drupal 12. Contrib and custom modules will need enough time to change their code or create the sequences table themselves
Proposed resolution
Remove the sequences table in Drupal 12
Remaining tasks
TBD
User interface changes
None
API changes
Sequences table will be removed
Data model changes
Sequences table will be removed
Release notes snippet
TBD
Issue fork drupal-3335756
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3335756-drop-sequences-table
changes, plain diff MR !14807
Comments
Comment #3
andypostComment #4
andypostComment #5
catchIsn't this supposed to be removed in Drupal 12? At least that's what the deprecation messages in the original issue said.
Comment #6
andypostsorry, mixed with method deprecation
Comment #8
mstrelan commentedLet's do this in #3573896: Remove deprecations from System module
Comment #10
mstrelan commentedI take that back, there are complications with
install_begin_requestininstall.core.incthat need untangling and it might be better to address that here. Specifically this bit:Comment #11
catchTheoretically (very theoretically), this might allow us to remove the special casing of system module in the early installer altogether. We should see what happens if that hunk is removed.
Comment #12
mstrelan commentedI don't think we can just remove this hunk. There is also
install_verify_database_readywhich looks atsystem_schema. If the last table in that function (i.e. sequences) exists then this prevents installing Drupal over and existing installation. With the sequences table gone we lose that check. Perhaps we can check for a different table? It looks likekey_valueis the first to be created, followed byconfig. But is it possible that someone is swapping out those services so they are not in the database after all? Not sure if that's possible at install time.Comment #13
andypostbtw Drush already doing a check for
key_valuetable to detect install https://github.com/drush-ops/drush/blob/14.x/src/Boot/DrupalBoot8.php#L162Comment #14
andypostI bet even if some module override this (for example mongodb) then Drush will fail somehow OTOH before install core probably should create some tables, so I bet we can remove this check at all
PS: Code search showing no usage in contrib so we can remove it
Comment #16
andypostCreate WIP MR to see if it will work as no usage of the
system_schema()found, not sure about check and commentsetUpCurrentUser()incore/modules/user/tests/src/Traits/UserCreationTrait.phpAlso curious to explore #11
Comment #17
andypostComment #18
andypostComment #19
andypostAfter removal system module can be installed https://git.drupalcode.org/project/drupal/-/merge_requests/14809/diffs?c...
removed testing commit for #11 as it need more changes breaking resumed installs (when browser closed while install) so the two-phase bootstrap can be removed if
drupal_install_system()and services become idempotent to re-run installer. Needs follow-up for that like #2934063: Remove the workaround in \Drupal\Core\Installer\ExtensionListTrait::setPathname() which fails one test nowComment #20
catchmongodb is implemented as a database driver so most of the time it's not actually swapping out database tables but creating collections with the same name so things work transparently - I think, this is based on what @daffie has told me not manual review.
In the early installer, even if you have an alternative database driver that is swapping something out, it's not an installed module yet, so the swapping wouldn't be possible at that point anyway.
tl;dr I think it's OK to rely on key_value here.
Comment #21
andypostFiled #3574200: Get rid of 2-phase kernel boot in installer
Comment #22
dcam commentedI assume this needs update path tests, so I'm tagging for them and setting the status to Needs Work.
Otherwise, I didn't find anything to comment on. The sequences table isn't installed anymore. The update function removes it from existing installs. The installer redirects properly if the key_value table is missing. It was a little hard to test the partial install state functionality of core.install.inc, but I think I got it. It worked properly.
Comment #23
catchFor update path tests, because this is a system update it will be run in every update path test anyway, so I think we could find a generic one and add an assertion there that the table no longer exists after the update? Can't think of anything else though.
Comment #24
andypostAdded to
core/modules/system/tests/src/Functional/Update/RouteAliasUpdateTest.phpas it's only one that already testing database upgradeComment #25
dcam commentedThat looks OK to me. Thank you.
Comment #26
catchWe can't add this to the update path test for route aliases, because that update path will be removed entirely in 12.x when we remove all updates added prior to 11.3.0
Comment #27
andypostyep,
system_update_11201will gone in 12.x but update is 12000 so probably better to make it 1x001 so the whole could be removed for 12.xComment #28
andypostOnly TODO can solve it even for new test
Comment #29
catchNew test coverage looks good.
Comment #31
catchCommitted/pushed to main, thanks!
This took years, and good to finally get there!