[REQ][MySQL] snake_case table and column names
Created by: ybelenko
Is your feature request related to a problem? Please describe.
Current MySQL schema generator is far from perfect. I think that output of this generator should look exactly like mysqldump
utility output or PHPMyAdmin SQL export. mysqldump
and PHPMyAdmin are both stable and well-tested solutions, so same output would be a great achievement.
This particular issue is not about syntax, but SQL coding style. snake_case
variables are what db developers used to see.
Describe the solution you'd like
Let's convert all table/column names to snake_case
. Original variable name can be mentioned in table/column comment.
CREATE TABLE IF NOT EXISTS `file` (
`source_uri` TEXT DEFAULT NULL COMMENT 'Original param name \'sourceURI\' '
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Original model name \'File\'';
Should we add generator option to disable this enhancement?
Where in codegen we should store snake_case
name?
Additional context
I'm working on it, just want to track progress. Any suggestions or tips are welcome.