Problem with migrating a model in ruby
Posted
by Shreyas Satish
on Stack Overflow
See other posts from Stack Overflow
or by Shreyas Satish
Published on 2010-04-09T17:12:32Z
Indexed on
2010/04/09
17:23 UTC
Read the original article
Hit count: 331
I run script/generate model query
edit query.rb in models..
class Query < ActiveRecord::Base #I even tried Migrations instead of Base
def sef.up
create table :queries do|t|
t.string :name
end
end
def self.down
drop_table :queries
end
end
,run rake db:migrate.
and what I see in db is this:
mysql> desc queries;
+------------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+----------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| created_at | datetime | YES | | NULL | |
| updated_at | datetime | YES | | NULL | |
+------------+----------+------+-----+---------+----------------+
Where is the "name" field?
HELP ! Cheers !
© Stack Overflow or respective owner