Forum: Ruby on Rails How do you define database tables?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
petermichaux (Guest)
on 2005-11-17 01:17
(Received via mailing list)
Hi,
 I was asking before if people use the ActiveRecord create table method
to
ensure portable table definitions. Seems like no one does it that way. I
wonder why and also if people are so interested in database abstraction
then
how do they avoid writing raw SQL.
 Thanks,
Peter
phil (Guest)
on 2005-11-17 01:35
(Received via mailing list)
Peter M. wrote:
 > Hi,
 >
 > I was asking before if people use the ActiveRecord create table
method
 > to ensure portable table definitions. Seems like no one does it that
 > way. I wonder why and also if people are so interested in database
 > abstraction then how do they avoid writing raw SQL.

We're working on a project with about 40 tables (about 10 of them join
tables).  We started in a spreadsheet, then moved to a sql file full of
creates and permission settings, and now modify and keep that file up to
date as we work.

Most things we do (CRUD) is abstracted, but some things have to be
semi-raw or raw.

The Rails book (agile dev with Rails) seems to assume you would start
with SQL definitions.  It seems easier that way to get permissions,
defaults, etc. set up.  I'm not sure if using AR would make things any
easier (for us anyway) and I don't know if it we could have been able to
set permissions and other attributes as easily.


Phil
alex (Guest)
on 2005-11-17 01:38
(Received via mailing list)
Peter M. wrote:
> Hi,
>
> I was asking before if people use the ActiveRecord create table method
> to ensure portable table definitions. Seems like no one does it that
> way. I wonder why and also if people are so interested in database
> abstraction then how do they avoid writing raw SQL.

I can only answer for myself, but AR migrations are perfectly good
enough for me, as long as I don't feel the need to pull in from ODBC or
write to SQLite.  But those are just constraints of the environment I'm
in, and pretty variable at that.
This topic is locked and can not be replied to.