テーブル名が長すぎるテーブルを探すSQL
SELECT TABLE_NAME as Name, CHAR_LENGTH(TABLE_NAME) from information_schema.TABLES
WHERE TABLE_SCHEMA = DATABASE() ORDER BY 2;
カラム名に予約語を使ってないか調べるSQL
SELECT * from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = DATABASE()
AND COLUMN_NAME IN (
"access",
"add",
"all",
"alter",
"and",
"any",
"as",
"asc",
"audit",
"between",
"by",
"char",
"check",
"cluster",
"column",
"comment",
"compress",
"connect",
"create",
"current",
"date",
"decimal",
"default",
"delete",
"desc",
"distinct",
"drop",
"else",
"exclusive",
"exists",
"file",
"float",
"for",
"from",
"grant",
"group",
"having",
"identified",
"immediate",
"in",
"increment",
"index",
"initial",
"insert",
"integer",
"intersect",
"into",
"is",
"level",
"like",
"lock",
"long",
"maxextents",
"minus",
"mlslabel",
"mode",
"modify",
"noaudit",
"nocompress",
"not",
"nowait",
"null",
"number",
"of",
"offline",
"on",
"online",
"option",
"or",
"order",
"pctfree",
"prior",
"privileges",
"public",
"raw",
"rename",
"resource",
"revoke",
"row",
"rowid",
"rownum",
"rows",
"select",
"session",
"set",
"share",
"size",
"smallint",
"start",
"successful",
"synonym",
"sysdate",
"table",
"then",
"to",
"trigger",
"uid",
"union",
"unique",
"update",
"user",
"validate",
"values",
"varchar",
"varchar2",
"view",
"whenever",
"where",
"with"
);
◯◯TEXT型を使ってないか調べるSQL
SELECT * from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = DATABASE() and DATA_TYPE like "%TEXT";
色々ハードルがありますねー