# Bootrapping a database using Capistrano

**URL:** <https://www.ruby-forum.com/t/bootrapping-a-database-using-capistrano/111874>\
**Category:** Deployment\
**Created:** [August 12, 2007, 9:11pm UTC](https://www.ruby-forum.com/t/bootrapping-a-database-using-capistrano/111874 "2007-08-12T21:11:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [August 12, 2007, 9:11pm UTC](https://www.ruby-forum.com/t/bootrapping-a-database-using-capistrano/111874/1 "2007-08-12T21:11:10Z")

</div>

Hi,

I used “rake db:schema:dump” to generate a file containing:

ActiveRecord::Schema.define(:version =\> 20) do

create\_table “connections”, :force =\> true do |t|

…

So it has everything needed to generate my database (I already created  
it and it’s waiting on the server, empty). How do I automate this… the  
result has to be a ready database without a lot of trouble.

I also hope to automatically generate that meta-table that stores the  
version… (is that getting generated from :version =\> X line there)?

I never tried to do this so I would be really happy about some pointers  
in the right direction. Couldn’t really find a lot about this on the  
net.

Thank you!  
David

---

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [August 12, 2007, 9:15pm UTC](https://www.ruby-forum.com/t/bootrapping-a-database-using-capistrano/111874/2 "2007-08-12T21:15:24Z")

</div>

On 8/12/07, D. Krmpotic [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I used “rake db:schema:dump” to generate a file containing:  
> So it has everything needed to generate my database (I already created  
> it and it’s waiting on the server, empty). How do I automate this… the  
> result has to be a ready database without a lot of trouble.

Read up on Rails migration, and make the current schema dump your 1st  
migration. Once you are in production, you will have to use  
migrations, anyway.

–  
Alex

---

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [August 12, 2007, 9:29pm UTC](https://www.ruby-forum.com/t/bootrapping-a-database-using-capistrano/111874/3 "2007-08-12T21:29:02Z")

</div>

ah ok… so that’s the best way… I know about migrations… it makes  
sense…

thank you  
david

Alexey V. wrote:

> On 8/12/07, D. Krmpotic [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I used “rake db:schema:dump” to generate a file containing:  
> > So it has everything needed to generate my database (I already created  
> > it and it’s waiting on the server, empty). How do I automate this… the  
> > result has to be a ready database without a lot of trouble.
> 
> Read up on Rails migration, and make the current schema dump your 1st  
> migration. Once you are in production, you will have to use  
> migrations, anyway.
> 
> –  
> Alex

---

<div class="post-metadata">

**Author:** ![dxk3355](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@dxk3355](https://www.ruby-forum.com/u/dxk3355)\
**Post date:** [August 12, 2007, 9:57pm UTC](https://www.ruby-forum.com/t/bootrapping-a-database-using-capistrano/111874/4 "2007-08-12T21:57:29Z")

</div>

And, check out “enhanced\_migrations”, which are really nice when you  
are working on a project with more than one person, etc.

> **[\[PLUGIN RELEASE\] Enhanced Rails Migrations v1.1.0](http://revolutiononrails.blogspot.com/2007/02/plugin-release-enhanced-rails.html)**
>
> Enhanced Rails Migrations is a plugin that makes easier rails development in a large team with multiple code branches. Native rails db migr...

On 8/12/07, D. Krmpotic [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > So it has everything needed to generate my database (I already created  
> > > –  
> > > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
Chris B.  
removed\_email\_address@domain.invalid
