MySQL has a nice feature that you can make a new table exectly like an old table (as far as table column structure and indexes go):
create table FOO like BAR;
However, as I just rediscovered, any triggers on the table aren’t taken across with it. D’oh. Which reminds me, mysqldump has a specific
-R flag to backup/dump routines; worth having that on too (I did).
Rule for the day: check your triggers on tables before moving/renaming.