遷移模型我運行腳本/生成模型查詢在模型問題與紅寶石
編輯query.rb ..
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
,運行耙分貝:遷移。
和我在DB看到是這樣的:
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 | |
+------------+----------+------+-----+---------+----------------+
在哪裏 「名稱」 字段?
幫助!乾杯!
您是否嘗試過重新啓動MySQL服務器來強制更新information_schema? – meagar 2010-04-09 17:19:14