You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ./mysqldef -uroot --file=schema.sql --dry-run test01
-- dry run --
ALTER TABLE tools ADD key `index_tools_02`(name);
ALTER TABLE tools ADD key `index_tools_03`(character);
Step5. Do mysqldef as applying, but error occurred.
$ ./mysqldef -uroot --file=schema.sql test01
-- Apply --
ALTER TABLE tools ADD key `index_tools_02`(name);
ALTER TABLE tools ADD key `index_tools_03`(character);
2020/06/15 18:20:56 Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character)' at line 1
I guess that 'character' is the mysql reserved word, so the column name must surround backquotes like:
ALTER TABLE tools ADD key `index_tools_03`(`character`);
The text was updated successfully, but these errors were encountered:
Step to reproduce
My environment:
Step1. Create database
Step2. Initialize table
Step3. Write schema.sql file.
index_tools_02
indexindex_tools_03
indexStep4. Do mysqldef as dry-run. No problems.
Step5. Do mysqldef as applying, but error occurred.
I guess that 'character' is the mysql reserved word, so the column name must surround backquotes like:
The text was updated successfully, but these errors were encountered: