# Migrations and Unintialized Constants Error

**URL:** <https://www.ruby-forum.com/t/migrations-and-unintialized-constants-error/65699>\
**Category:** Rails\
**Created:** [February 11, 2006, 2:47am UTC](https://www.ruby-forum.com/t/migrations-and-unintialized-constants-error/65699 "2006-02-11T02:47:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [February 11, 2006, 2:47am UTC](https://www.ruby-forum.com/t/migrations-and-unintialized-constants-error/65699/1 "2006-02-11T02:47:03Z")

</div>

I am running into a problem with two of my tables and the  
“uninitialized constant” error when using migration.

I get the “uninitialized constant Note” when running the following  
code in my migration file:

```
 create_table :notes do |t|
   t.column :id, :integer
   t.column :noteshare_id, :integer
   t.column :title, :string
   t.column :covered, :string
   t.column :content, :text
   t.column :created_at, :datetime
   t.column :updated_at, :datetime
 end
 Note.create_versioned_table

```

The same thing happens with:

```
 create_table :faculties do |t|
   t.column :id, :integer
   t.column :school_id, :integer
   t.column :name, :string
   t.column :created_at, :datetime
   t.column :updated_at, :datetime
 end
 Faculty.create :school_id => 1, :name => "Faculty of Engineering

```

and Computer Science"

Anyone can give me some insight into my problem please 🙂

Would be greatly appreciated :-).

Your Friend,

John K.  
[http://www.kopanas.com](http://www.kopanas.com)

=====================================================================  
[http://www.soen.info](http://www.soen.info) - source of the freshest software engineering  
information on the net  
[http://cusec.soen.info](http://cusec.soen.info) - software engineering conference

---

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [February 11, 2006, 3:11am UTC](https://www.ruby-forum.com/t/migrations-and-unintialized-constants-error/65699/2 "2006-02-11T03:11:25Z")

</div>

Do you have a Note model?

Does it compile without error?

P.S. If you’re using acts\_as\_versioned, then you need a version column  
in that table as well.

–  
– Tom M.

---

<div class="post-metadata">

**Author:** ![johnk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@johnk](https://www.ruby-forum.com/u/johnk)\
**Post date:** [February 11, 2006, 7:53am UTC](https://www.ruby-forum.com/t/migrations-and-unintialized-constants-error/65699/3 "2006-02-11T07:53:35Z")

</div>

For notes I fixed everything thanks. Stupid me I called the model  
Notes instead of just note.

On 10-Feb-06, at 9:11 PM, Tom M. wrote:

> > ```
> > t.column :covered, :string
> > t.column :school_id, :integer
> > 
> > ```
> > 
> > * * *
> > 
> > Rails mailing list  
> > removed\_email\_address@domain.invalid  
> > [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

John K.  
[http://www.kopanas.com](http://www.kopanas.com)

=====================================================================  
[http://www.soen.info](http://www.soen.info) - source of the freshest software engineering  
information on the net  
[http://cusec.soen.info](http://cusec.soen.info) - software engineering conference
