rails/rails — pull request #14480 by steverice (2014-03-26 05:19:01+00:00)
Title: Create indexes inline in CREATE TABLE for MySQL

When using `mysql` or `mysql2` adapters, fold index creation into `CREATE TABLE` statements. This has a few benefits:
- requires fewer SQL statements to create a table
- can reverse a table-creating migration with a single `DROP TABLE` statement, instead of unnecessarily removing all indexes and then dropping (big performance penalty for large tables)
- requires having only `CREATE` permissions on a database, instead of `CREATE` + `INDEX` permissions
- prevents early committing of transactions when adding indexes to temporary tables

This is intended as a replacement for @ccutrer's #13787. It fixes some bugs and test failures with that PR and updates tests.

I am happy to squash the commits together, however I left as-is to avoid crushing @ccutrer's authorship.