Made get_table_list return a TableInfo named tuple
Fixed #18782 -- Prevented sql_flush to flush views

Thanks rodolfo_3 for the report and the initial patch, and
Josh Smeaton, Shai Berger and Tim Graham for the reviews.
Called table_names instead of get_table_list in migrations