# \[Rails\] Where is create\_table method defined?

**URL:** <https://rubytalk.org/t/rails-where-is-create-table-method-defined/44382>\
**Category:** ruby-talk\
**Created:** [9 February 2008 03:50 UTC](https://rubytalk.org/t/rails-where-is-create-table-method-defined/44382 "2008-02-09T03:50:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![grz01](https://avatars.discourse-cdn.com/v4/letter/g/bc79bd/32.png) [@grz01](https://rubytalk.org/u/grz01)\
**Post date:** [9 February 2008 03:50 UTC](https://rubytalk.org/t/rails-where-is-create-table-method-defined/44382/1 "2008-02-09T03:50:02Z")

</div>

Hi

When scaffolding a model with Rails, you will get a migration file,  
say 001\_create\_items.rb  
that looks something like this:

class CreateItems \< ActiveRecord::Migration  
&nbsp;&nbsp;def self.up  
&nbsp;&nbsp;&nbsp;&nbsp;create\_table :items do |t|  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...  
&nbsp;&nbsp;&nbsp;&nbsp;end  
&nbsp;&nbsp;end

&nbsp;&nbsp;def self.down  
&nbsp;&nbsp;&nbsp;&nbsp;drop\_table :items  
&nbsp;&nbsp;end  
end

My question is: Where is this method 'create\_table' defined in Rails?  
I was expecting to find it in the superclass ActiveRecord::Migration  
which I think is defined in file .../lib/active\_record/migration.rb  
But I cannot find it there.

Anyone has a clue?

TIA  
------------- grz01
