# Specifying table type

**URL:** <https://www.ruby-forum.com/t/specifying-table-type/54871>\
**Category:** Rails\
**Created:** [March 14, 2006, 10:37pm UTC](https://www.ruby-forum.com/t/specifying-table-type/54871 "2006-03-14T22:37:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [March 14, 2006, 10:37pm UTC](https://www.ruby-forum.com/t/specifying-table-type/54871/1 "2006-03-14T22:37:11Z")

</div>

I’ve been creating my tables using the command line approach Dave  
advocates in AWD. I just noticed that they’re being created as  
MyISAM-type tables. I remember reading (but not where) that I should be  
creating these as InnoDB-type tables. So, two questions…

1. Is the table type important? (a “why” component to the answer would  
be nice too 😉 )

2. If so, is there a way to specify the table type using the command  
line approach?

Thanks in advance,  
Bill

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [March 15, 2006, 4:20am UTC](https://www.ruby-forum.com/t/specifying-table-type/54871/2 "2006-03-15T04:20:42Z")

</div>

InnoDB supports transactions… MyISAM does not.

CREATE TABLE tblname (  
columndefs…  
) ENGINE=InnoDB

[http://dev.mysql.com/doc/refman/4.1/en/create-table.html](http://dev.mysql.com/doc/refman/4.1/en/create-table.html)

b

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [March 15, 2006, 6:54am UTC](https://www.ruby-forum.com/t/specifying-table-type/54871/3 "2006-03-15T06:54:51Z")

</div>

Ben M. wrote:

> InnoDB supports transactions… MyISAM does not.
> 
> CREATE TABLE tblname (  
> columndefs…  
> ) ENGINE=InnoDB
> 
> [http://dev.mysql.com/doc/refman/4.1/en/create-table.html](http://dev.mysql.com/doc/refman/4.1/en/create-table.html)
> 
> b

Or, with migrations…

create\_table “tblname”, :force =\> true, :options =\> “ENGINE=InnoDB” do  
|t|  
t.column “colname”, :integer  
#…  
end

–josh

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [March 15, 2006, 4:39am UTC](https://www.ruby-forum.com/t/specifying-table-type/54871/4 "2006-03-15T04:39:17Z")

</div>

Thank you, Ben. Very much.

Best regards,  
Bill

----- Original Message -----  
From: “Ben M.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: 2006-03-14 9:18 PM  
Subject: Re: [Rails] specifying table type
