forked from grafana/grafana
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SQL: define primary key for tables without it
The annotation_tag and alert_rule_tag tables did not have PRIMARY KEY defined what cause problems with migration to MariaDB with Galera setup with innodb_force_primary_key=1 Or MySQL > 8.0.13 with sql_require_primary_key=ON Which can manifest as follows: MariaDB Error 1173: This table type requires a primary key MySQL ERROR 3750 (HY000): Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Extra reading for curious: https://jfg-mysql.blogspot.com/2017/08/danger-no-pk-with-RBR-and-mariadb-protection.html Fixes grafana#12971
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters