Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database upgrades after installation fail with DB Error #134

Open
jensschuppe opened this issue Sep 11, 2023 · 3 comments
Open

Database upgrades after installation fail with DB Error #134

jensschuppe opened this issue Sep 11, 2023 · 3 comments

Comments

@jensschuppe
Copy link

jensschuppe commented Sep 11, 2023

specifically in upgrade_1001() with:

CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_contact_layout` ADD COLUMN `tabs` longtext COMMENT 'Contains json encoded layout tabs.'");

since the column already exists.

I'm a bit confused actually as I thought that upgrade steps are not being executed when installing the extension with the latest revision. If that's what they're supposed to, each upgrade step will have to ensure it doesn't error when it is unnecessarily being executed.

@colemanw
Copy link
Member

@jensschuppe that's very strange. A normal install of an extension will automatically mark every old upgrade step as complete. Something might have gone wrong with your install?

@jensschuppe
Copy link
Author

Well, apparently something went wrong, but I'm not really sure what. The extension finished installing without complaints (using cv ext:enable). Does the installer code scan for upgrade steps and insert the highest schema version when installing an extension? Maybe that got interrupted somehow ...

Anyway: If the upgrade step was more forgiving, there wouldn't be an error at all. Unfortunately, IF NOT EXISTS is not supported with ADD COLUMN for all MySQL/MariaDB versions. But if it's just me getting this error ...

@colemanw
Copy link
Member

Does the installer code scan for upgrade steps and insert the highest schema version when installing an extension?

Yes that's what it's supposed to do. The assumption is that all upgrade steps that exist at the time of the install are redundant with the installer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants