Steps to replicate the issue (include links if applicable):
- Run sqlite CI
What happens?:
Install fails with error:
Wikimedia\Rdbms\DBQueryError from line 1534 of /workspace/src/includes/libs/rdbms/database/Database.php: Error 1: no such column: cul_reason 21:35:13 Function: Wikimedia\Rdbms\Database::sourceFile( /workspace/src/extensions/CheckUser/src/../schema/sqlite/patch-cu_log-drop-actor_default.sql ) 21:35:13 Query: CREATE TEMPORARY TABLE "__temp__cu_log" AS 21:35:13 SELECT cul_id, cul_timestamp, cul_actor, cul_reason, cul_reason_id, cul_reason_plaintext_id, cul_type, cul_target_id, cul_target_text, cul_target_hex, cul_range_start, cul_range_end 21:35:13 FROM "cu_log" 21:35:13 21:35:13 21:35:13 #0 /workspace/src/includes/libs/rdbms/database/Database.php(1518): Wikimedia\Rdbms\Database->getQueryException() 21:35:13 #1 /workspace/src/includes/libs/rdbms/database/Database.php(1492): Wikimedia\Rdbms\Database->getQueryExceptionAndLog() 21:35:13 #2 /workspace/src/includes/libs/rdbms/database/Database.php(865): Wikimedia\Rdbms\Database->reportQueryError() 21:35:13 #3 /workspace/src/includes/libs/rdbms/database/Database.php(3087): Wikimedia\Rdbms\Database->query() 21:35:13 #4 /workspace/src/includes/libs/rdbms/database/Database.php(3026): Wikimedia\Rdbms\Database->sourceStream() 21:35:13 #5 /workspace/src/includes/installer/DatabaseUpdater.php(716): Wikimedia\Rdbms\Database->sourceFile() 21:35:13 #6 /workspace/src/includes/installer/DatabaseUpdater.php(998): DatabaseUpdater->applyPatch() 21:35:13 #7 /workspace/src/includes/installer/DatabaseUpdater.php(547): DatabaseUpdater->modifyField() 21:35:13 #8 /workspace/src/includes/installer/DatabaseUpdater.php(515): DatabaseUpdater->runUpdates() 21:35:13 #9 /workspace/src/includes/installer/DatabaseInstaller.php(349): DatabaseUpdater->doUpdates() 21:35:13 #10 /workspace/src/includes/installer/Installer.php(1670): DatabaseInstaller->createExtensionTables() 21:35:13 #11 /workspace/src/includes/installer/CliInstaller.php(211): Installer->performInstallation() 21:35:13 #12 /workspace/src/maintenance/install.php(142): CliInstaller->execute() 21:35:13 #13 /workspace/src/maintenance/includes/MaintenanceRunner.php(585): CommandLineInstaller->execute() 21:35:13 #14 /workspace/src/maintenance/doMaintenance.php(99): MediaWiki\Maintenance\MaintenanceRunner->run() 21:35:13 #15 /workspace/src/maintenance/install.php(201): require_once('/workspace/src/...') 21:35:13 #16 {main}
For new installs the updatelog won't contain that these patches have been run. For sqlite some updates use a temporary table, which means that there cannot be any new or removed fields (as the temporary table change would remove the newly added ones and fail with an error when it's missing). This can be fixed by ensuring any schema changes that are only needed for installs that are not new are only run on second runs of update.php after installing CheckUser.