Last active
September 19, 2023 11:26
-
-
Save brihter/8800941 to your computer and use it in GitHub Desktop.
The script will generate the missing opencart indexes. Copy the result and execute it on the target schema.
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
use information_schema; | |
select | |
concat('alter table `', c.table_name, '` add index `ix_', c.column_name, '` (`',c.column_name,'`);') | |
from columns c | |
where c.table_schema = 'SCHEMA_NAME' | |
and lower(c.column_name) like '%_id%' | |
and c.column_key = ''; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment