rails/rails — pull request #12811 by ereslibre (2013-11-08 17:16:59+00:00)
Title: Include environment in db:setup task

If railties (engines) contain migrations 'rake db:schema:load' imports all migrations in schema_migrations table, while 'rake db:setup' does not.

On the same project, which includes engines that have migrations on their own, running:

- rake db:schema:load produces:

mysql> select count(1) from schema_migrations;
+----------+
| count(1) |
+----------+
| 240 |
+----------+

- while rake db:setup produces:

mysql> select count(1) from schema_migrations;
+----------+
| count(1) |
+----------+
| 127 |
+----------+

The correct one is the first one, that includes all migrations. I can call db:create, db:schema:load and db:seed separately for now, but I'd like to use db:seed as one command only is always better than tree.

I'd be happy to add a test case if possible.