# Legacy database tricks and techniques

**URL:** <https://www.ruby-forum.com/t/legacy-database-tricks-and-techniques/159434>\
**Category:** Rails\
**Created:** [February 4, 2009, 2:59pm UTC](https://www.ruby-forum.com/t/legacy-database-tricks-and-techniques/159434 "2009-02-04T14:59:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [February 4, 2009, 2:59pm UTC](https://www.ruby-forum.com/t/legacy-database-tricks-and-techniques/159434/1 "2009-02-04T14:59:11Z")

</div>

I have been looking for a “definitive” guide to legacy database  
support for Rails and I am coming up relatively empty. There are a few  
tips and tricks out there but no specific step by step guide for  
integrating rails (Activerecord) with legacy schemas. Anybody seen a  
good one and can post a link?

I have a legacy DB where table name pluralization isn’t an option  
(easily fixed) and where table names follow absolutely no convention  
whatsoever, where primary keys are rarely, if ever, a sequentially  
assigned numeric field. Primary key values are usually user assigned  
values rather than auto incremented values and they can be both  
numeric and character. Some tables have compound keys.

I have seen all of these addressed in specific, separate ways but I  
haven’t found anything that deals with all the possible issues  
implementing Rails in a legacy world.

Suggestions?
