# Legacy Database

**URL:** <https://www.ruby-forum.com/t/legacy-database/89473>\
**Category:** Deployment\
**Created:** [March 20, 2007, 7:51pm UTC](https://www.ruby-forum.com/t/legacy-database/89473 "2007-03-20T19:51:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dominatorsc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/94ad74/32.png) [@dominatorsc](https://www.ruby-forum.com/u/dominatorsc)\
**Post date:** [March 20, 2007, 7:51pm UTC](https://www.ruby-forum.com/t/legacy-database/89473/1 "2007-03-20T19:51:23Z")

</div>

How does one (a complete newbie) model and scafford an legacy database  
remotely. The tables appear to be in the correct form of pural names and  
the connection is correct

any help would be greatfully

---

<div class="post-metadata">

**Author:** ![dominatorsc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/94ad74/32.png) [@dominatorsc](https://www.ruby-forum.com/u/dominatorsc)\
**Post date:** [March 20, 2007, 9:04pm UTC](https://www.ruby-forum.com/t/legacy-database/89473/2 "2007-03-20T21:04:36Z")

</div>

Not being a huge expert myself, here’s what I would do:

1. Setup model files (by hand for each table) app/model/table.rb
2. Set any naming exceptions in each model file (if columns are not  
well named for example)
3. Setup your database config to point to your remote database  
(config/database.yml)

Now you can generate scaffolds to deal with it. I’d just loadup the  
console (script/console) first, and do some test queries to see if you  
can connect. Eg:

# script/console

# \> Table.find(:first)

etc.

- Erison Smith  
[http://www.funadvice.com](http://www.funadvice.com)
