Make mysql work for some special cases (database case, views, foreign keys)
Currently in MySQL if lower_case_table_names is set to 2 then when your database name has an uppercase character database-cleaner will fail because the show tables query returns using a column of Tables_in_<lowercase DB name>
Also, if you have views, it will fail.
Also, if any tables have foreign key constraints, it will fail.
-
Check the value of lower_case_table_names and if it is 2 then lowercasing the database name when constructing the expected column name seems to fix it.
-
Exclude views when getting table names to truncate so that it doesn't error on them.
-
Disable foreign key checks so that it doesn't fail on them
Hi @hutchiep190,
I just reviewed your PR. It's a good improvement to the library.
Can you please add some tests to the scenários you are covering so I can integrate quickly?
Cheers,
Emerson
@emerleite Hi,
I was using your package for my tests when I came across Foreign Key Checks. I guess any good mysql db would have foreign key checks enabled. Are you by any chance active on this repo ? Even if you are not, would you mind accepting and merging a PR with the changes ?
Hi @palashjhabak. I just need to checkit agian to see if not breaks anything.