# Explain this migrate line?

**URL:** <https://www.ruby-forum.com/t/explain-this-migrate-line/158076>\
**Category:** Rails\
**Created:** [January 19, 2009, 4:06am UTC](https://www.ruby-forum.com/t/explain-this-migrate-line/158076 "2009-01-19T04:06:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![typemismatch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b9bd4f/32.png) [@typemismatch](https://www.ruby-forum.com/u/typemismatch)\
**Post date:** [January 19, 2009, 4:06am UTC](https://www.ruby-forum.com/t/explain-this-migrate-line/158076/1 "2009-01-19T04:06:18Z")

</div>

So I have this code in a migration file …

```
create_table :books do |t|
  t.column "Title", :string
  t.column "Price", :decimal
  t.timestamps
end

```

Are “Title” and :string just parameters being passed to the method  
t.column?

If so, I understand that “Title” is a string parameter, what  
is :string? a type param?

Thanks  
-c

---

<div class="post-metadata">

**Author:** ![typemismatch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b9bd4f/32.png) [@typemismatch](https://www.ruby-forum.com/u/typemismatch)\
**Post date:** [January 19, 2009, 4:32am UTC](https://www.ruby-forum.com/t/explain-this-migrate-line/158076/2 "2009-01-19T04:32:02Z")

</div>

Title : name of the column  
string : type of the column. it maps to varchar/varchar2

Similarly for Price

[http://api.rubyonrails.com/classes/ActiveRecord/Migration.html](http://api.rubyonrails.com/classes/ActiveRecord/Migration.html)

–  
Shiv N Gautam

On Mon, Jan 19, 2009 at 8:35 AM, typemismatch [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> t.column?
> 
> If so, I understand that “Title” is a string parameter, what  
> is :string? a type param?
> 
> Thanks  
> -c
> 
> >

–

E. B. White - “Genius is more often found in a cracked pot than in a  
whole  
one.”

---

<div class="post-metadata">

**Author:** ![typemismatch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b9bd4f/32.png) [@typemismatch](https://www.ruby-forum.com/u/typemismatch)\
**Post date:** [January 19, 2009, 12:30pm UTC](https://www.ruby-forum.com/t/explain-this-migrate-line/158076/3 "2009-01-19T12:30:23Z")

</div>

On 19 Jan 2009, at 03:05, typemismatch wrote:

> t.column?
> 
> If so, I understand that “Title” is a string parameter, what  
> is :string? a type param?

:string is a symbol  
see

> **[13 Ways of Looking at a Ruby Symbol | Random Hacks](http://www.randomhacks.net.s3-website-us-east-1.amazonaws.com/2007/01/20/13-ways-of-looking-at-a-ruby-symbol/)**
>
> Random code snippets, projects and musings about software from Eric Kidd, a developer and occasional entrepreneur.

or  
[http://blog.hasmanythrough.com/2008/4/19/symbols-are-not-pretty-strings](http://blog.hasmanythrough.com/2008/4/19/symbols-are-not-pretty-strings)

Fred
