Skip to content

Commit

Permalink
instructions for running migrations in another ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Oct 2, 2012
1 parent ddcda85 commit eb85394
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion guides/source/migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ support](#active-record-and-referential-integrity).
If the helpers provided by Active Record aren't enough you can use the `execute`
method to execute arbitrary SQL.

For more details and examples of individual methods, check the API documentation.
For more details and examples of individual methods, check the API documentation.
In particular the documentation for
[`ActiveRecord::ConnectionAdapters::SchemaStatements`](http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html)
(which provides the methods available in the `up` and `down` methods),
Expand Down Expand Up @@ -700,6 +700,14 @@ will run the `up` method from the 20080906120000 migration. This task will first
check whether the migration is already performed and will do nothing if Active Record believes
that it has already been run.

### Running Migrations in Different Environments

By default running `rake db:migrate` will run in the `development` environment. To run migrations against another environment you can specify it using the `RAILS_ENV` environment variable while running the command. For example to run migrations against the `test` environment you could run:

```bash
$ rake db:migrate RAILS_ENV=test
```

### Changing the Output of Running Migrations

By default migrations tell you exactly what they're doing and how long it took.
Expand Down

0 comments on commit eb85394

Please sign in to comment.