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

Support disabling sql_generate_invisible_primary_key via MySQL configuration entry (resolves MySQL 8.x issue as reported by REDCap database checks) #52

Open
epopisces opened this issue Nov 20, 2023 · 1 comment
Labels
terraform Items related to the Terraform IaC code
Milestone

Comments

@epopisces
Copy link

epopisces commented Nov 20, 2023

As reported in the REDCap Community forums, building REDCap from scratch when using the latest 8.x version of MySQL is (sporadically) resulting in the following error:
YOUR REDCAP DATABASE STRUCTURE IS INCORRECT

The solution is to set the sql_generate_invisible_primary_key value on the MySQL flexible server to 'OFF' prior to running the REDCap install script for the database.

Via Terraform these could be implemented via an azurerm_mysql_flexible_server_configuration resource:

resource "azurerm_mysql_flexible_server_configuration" "disable_invisible_primary_key" {
  resource_group_name = azurerm_resource_group.redcap.name
  server_name         = azurerm_mysql_flexible_server.redcap.name
  name                = "sql_generate_invisible_primary_key"
  value               = "OFF"
}

I have not yet tested whether this has an impact when using prior version of MySQL: if so it could include a count = startswith(var.mysqlVersion, "8") ? 1 : 0. Or even better such a conditional used in a locals block should add a map an argument to a merge() function such as suggested in #50 (preferred).

@epopisces epopisces changed the title Support disabling sql_generate_invisible_primary_key MySQL configuration entry (resolves MySQL 8.x issue as reported by REDCap database checks) Support disabling sql_generate_invisible_primary_key via MySQL configuration entry (resolves MySQL 8.x issue as reported by REDCap database checks) Nov 20, 2023
@epopisces epopisces changed the title Support disabling sql_generate_invisible_primary_key via MySQL configuration entry (resolves MySQL 8.x issue as reported by REDCap database checks) Terraform: support disabling sql_generate_invisible_primary_key via MySQL configuration entry (resolves MySQL 8.x issue as reported by REDCap database checks) Nov 20, 2023
@epopisces epopisces changed the title Terraform: support disabling sql_generate_invisible_primary_key via MySQL configuration entry (resolves MySQL 8.x issue as reported by REDCap database checks) Support disabling sql_generate_invisible_primary_key via MySQL configuration entry (resolves MySQL 8.x issue as reported by REDCap database checks) Nov 20, 2023
@SvenAelterman SvenAelterman added the terraform Items related to the Terraform IaC code label Nov 25, 2023
@SvenAelterman
Copy link
Contributor

This has been resolved in the Bicep code. It does not work with SQL versions prior to 8.0.30.

@SvenAelterman SvenAelterman added this to the Backlog milestone Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
terraform Items related to the Terraform IaC code
Projects
None yet
Development

No branches or pull requests

2 participants