# How: From database to "schema.rb" file?

**URL:** <https://www.ruby-forum.com/t/how-from-database-to-schema-rb-file/162178>\
**Category:** Rails\
**Created:** [March 6, 2009, 2:15pm UTC](https://www.ruby-forum.com/t/how-from-database-to-schema-rb-file/162178 "2009-03-06T14:15:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 6, 2009, 2:15pm UTC](https://www.ruby-forum.com/t/how-from-database-to-schema-rb-file/162178/1 "2009-03-06T14:15:12Z")

</div>

Hi there!

Is there a way to get a complete/up-to-date “schema.rb” file, based on  
just the database? (without using any migration files…)

===========================  
Background:

1. I had stopped using migrations at some point in time and then have  
modified my db “manually”, using phpMyAdmin.

2. Now, I’d like to start using migrations again, since plugins often  
“require” migrations.  
===========================

Thanks for any comments on this!  
Tom

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 6, 2009, 2:17pm UTC](https://www.ruby-forum.com/t/how-from-database-to-schema-rb-file/162178/2 "2009-03-06T14:17:03Z")

</div>

rake db:schema:dump

- 

Maurício Linhares  
[http://alinhavado.wordpress.com/](http://alinhavado.wordpress.com/) (pt-br) | [http://blog.codevader.com/](http://blog.codevader.com/)  
(en)

On Fri, Mar 6, 2009 at 10:15 AM, Tom Ha

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 6, 2009, 2:22pm UTC](https://www.ruby-forum.com/t/how-from-database-to-schema-rb-file/162178/3 "2009-03-06T14:22:41Z")

</div>

Thanks a lot !
