# Run migration from with rails project

**URL:** <https://www.ruby-forum.com/t/run-migration-from-with-rails-project/113506>\
**Category:** Rails\
**Created:** [August 31, 2007, 11:06pm UTC](https://www.ruby-forum.com/t/run-migration-from-with-rails-project/113506 "2007-08-31T23:06:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jngo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@jngo](https://www.ruby-forum.com/u/jngo)\
**Post date:** [August 31, 2007, 11:06pm UTC](https://www.ruby-forum.com/t/run-migration-from-with-rails-project/113506/1 "2007-08-31T23:06:39Z")

</div>

I want to dynamically create and populate databases on the fly, and I  
would like to know how you would go about running a migration from with  
the rails project. I was thinking of doing it either in a model, or  
shelling out to the command line and running it from there. Any  
recommendations as to how you would go about accomplishing this?

---

<div class="post-metadata">

**Author:** ![jngo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@jngo](https://www.ruby-forum.com/u/jngo)\
**Post date:** [September 1, 2007, 7:05am UTC](https://www.ruby-forum.com/t/run-migration-from-with-rails-project/113506/2 "2007-09-01T07:05:12Z")

</div>

On Aug 31, 2:06 pm, John paul Narowski \<rails-mailing-l…@andreas-  
[s.net](http://s.net)\> wrote:

> ## I want to dynamically create and populate databases on the fly, and I would like to know how you would go about running a migration from with the rails project. I was thinking of doing it either in a model, or shelling out to the command line and running it from there. Any recommendations as to how you would go about accomplishing this?
> 
> Posted viahttp://www.ruby-forum.com/.

i suggest you invest some time reading AWDR, or any of the other quite  
good Rails tutorial-type books

“rake db:migrate”

---

<div class="post-metadata">

**Author:** ![jngo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@jngo](https://www.ruby-forum.com/u/jngo)\
**Post date:** [September 1, 2007, 6:43pm UTC](https://www.ruby-forum.com/t/run-migration-from-with-rails-project/113506/3 "2007-09-01T18:43:28Z")

</div>

> John paul Narowski wrote:

> > I want to dynamically create and populate databases on the fly, and I  
> > would like to know how you would go about running a migration from with  
> > the rails project. I was thinking of doing it either in a model, or  
> > shelling out to the command line and running it from there. Any  
> > recommendations as to how you would go about accomplishing this?

> i suggest you invest some time reading AWDR, or any of the other quite  
> good Rails tutorial-type books
> 
> “rake db:migrate”

And don’t do it from “in a model”. You are probably not discussing  
changing  
the database tables, on the fly, while the program runs.

Are you loading the application’s preset data?

–  
Phlip  
[http://www.oreilly.com/catalog/9780596510657/](http://www.oreilly.com/catalog/9780596510657/)  
“Test Driven Ajax (on Rails)”  
assert\_xpath, assert\_javascript, & assert\_ajax

---

<div class="post-metadata">

**Author:** ![jngo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@jngo](https://www.ruby-forum.com/u/jngo)\
**Post date:** [September 1, 2007, 7:30pm UTC](https://www.ruby-forum.com/t/run-migration-from-with-rails-project/113506/4 "2007-09-01T19:30:34Z")

</div>

DabbleDB is an example of an application that allows users to “create  
databases on the fly”, but they do not execute migrations from within  
the application. There are a number of reasons that they don’t – from  
security issues to stability issues to performance issues – and I  
would definitely advise against it and suggest that you look for an  
alternate solution, as DabbleDB has done.

Rein

On Aug 31, 4:06 pm, John paul Narowski \<rails-mailing-l…@andreas-
