# Database Modeller (Mac)

**URL:** <https://www.ruby-forum.com/t/database-modeller-mac/92618>\
**Category:** Rails\
**Created:** [April 21, 2007, 5:34pm UTC](https://www.ruby-forum.com/t/database-modeller-mac/92618 "2007-04-21T17:34:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barry\_Frost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5ac83/32.png) [@Barry\_Frost](https://www.ruby-forum.com/u/Barry_Frost)\
**Post date:** [April 21, 2007, 5:34pm UTC](https://www.ruby-forum.com/t/database-modeller-mac/92618/1 "2007-04-21T17:34:23Z")

</div>

Can anyone recommend a database modelling tool for the Mac? I’m  
building a new Rails app and want an interface to draw out the  
database’s entity relationship diagram, setup foreign keys and then  
output DDL at the end to MySQL.

I’ve previously used DBDesigner, CASE Studio and some pricier  
enterprise software on Windows, but can’t find anything suitable for  
my Mac. The MySQL Workbench project seems to have stalled and I can’t  
find anything suitable.

Any recommendations?

Thanks

Barry Frost

---

<div class="post-metadata">

**Author:** ![Barry\_Frost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5ac83/32.png) [@Barry\_Frost](https://www.ruby-forum.com/u/Barry_Frost)\
**Post date:** [April 21, 2007, 5:41pm UTC](https://www.ruby-forum.com/t/database-modeller-mac/92618/2 "2007-04-21T17:41:25Z")

</div>

On 21 Apr 2007, at 17:33, Barry Frost wrote:

> Any recommendations?  
> If you are happy with just creating diagrams and then using Rails  
> migrations to create your database scheme (from my point of view the  
> best thing to do anyway), you could use Omnigraffle.

There’s also DBVisualiser at [http://www.minq.se/products/dbvis/info.html](http://www.minq.se/products/dbvis/info.html)

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![Barry\_Frost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5ac83/32.png) [@Barry\_Frost](https://www.ruby-forum.com/u/Barry_Frost)\
**Post date:** [April 22, 2007, 5:24pm UTC](https://www.ruby-forum.com/t/database-modeller-mac/92618/3 "2007-04-22T17:24:18Z")

</div>

Using ActiveRecord with extra database level stuff like foreign key  
constraints, multiple-column primary keys, etc. is the Wrong Thing to  
do. I got burned by this and had to re-write my database schema in  
Rails 1.1.6. ActiveRecord will enforce most of that stuff for you if  
you tell it to.

Most of these tools will probably generate schemas that have that  
extra cruft. They’ll also probably not be compatible with migrations.

Just a word of warning…

---

<div class="post-metadata">

**Author:** ![Barry\_Frost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5ac83/32.png) [@Barry\_Frost](https://www.ruby-forum.com/u/Barry_Frost)\
**Post date:** [April 22, 2007, 5:34pm UTC](https://www.ruby-forum.com/t/database-modeller-mac/92618/4 "2007-04-22T17:34:19Z")

</div>

Multiple-column primary keys does not seem compatible with  
ActiveRecord as you say.

However, I disagree about not using foreign key constraints. These are  
wonderful, useful aids to maintain the referential integrity of the  
DB. When your code violates one, you get a SQL error immediately. It’s  
much easier to fix one of these than it is to try to debug an  
application that fails intermitently due to data error.

Personally, I have been doing relational database work since the 80’s,  
so I perfer to use dbms tools over rails migrations. Take what works  
and leave the rest when it comes to frameworks and development tools.

---

<div class="post-metadata">

**Author:** ![Barry\_Frost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5ac83/32.png) [@Barry\_Frost](https://www.ruby-forum.com/u/Barry_Frost)\
**Post date:** [April 22, 2007, 6:27pm UTC](https://www.ruby-forum.com/t/database-modeller-mac/92618/5 "2007-04-22T18:27:23Z")

</div>

Whatever happened to that AJAX one which was specifically designed for  
rails? ie, it would generate rails migrations and stuff. Someone posted  
a  
link to it here a while ago (although searching my mail archives, I  
can’t  
find it). That looked promising, even though it was in some kind of  
pre-alpha stage.

---

<div class="post-metadata">

**Author:** ![Barry\_Frost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5ac83/32.png) [@Barry\_Frost](https://www.ruby-forum.com/u/Barry_Frost)\
**Post date:** [April 22, 2007, 6:39pm UTC](https://www.ruby-forum.com/t/database-modeller-mac/92618/6 "2007-04-22T18:39:24Z")

</div>

On Apr 22, 2007, at 5:33 PM, dagny wrote:

> However, I disagree about not using foreign key constraints. These are  
> wonderful, useful aids to maintain the referential integrity of the  
> DB. When your code violates one, you get a SQL error immediately. It’s  
> much easier to fix one of these than it is to try to debug an  
> application that fails intermitently due to data error.

I agree, they are a great help to get a chain of has\_many :dependent  
right. You get an index for that column automatically as well at  
least in MySQL and a few more, so we use the plugin from RedHill  
Consulting in all our applications.

– fxn

---

<div class="post-metadata">

**Author:** ![Barry\_Frost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5ac83/32.png) [@Barry\_Frost](https://www.ruby-forum.com/u/Barry_Frost)\
**Post date:** [April 22, 2007, 7:56pm UTC](https://www.ruby-forum.com/t/database-modeller-mac/92618/7 "2007-04-22T19:56:29Z")

</div>

[SQLEditor](http://www.malcolmhardie.com/sqleditor/) is not free, but it  
does  
nice ERDs and does Rails migrations.

# Damian

---

<div class="post-metadata">

**Author:** ![Barry\_Frost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b5ac83/32.png) [@Barry\_Frost](https://www.ruby-forum.com/u/Barry_Frost)\
**Post date:** [April 23, 2007, 3:05am UTC](https://www.ruby-forum.com/t/database-modeller-mac/92618/8 "2007-04-23T03:05:16Z")

</div>

[http://railroad.rubyforge.org/](http://railroad.rubyforge.org/)

may be what you are looking for.

Bill
