【发布时间】:2014-06-01 18:57:07
【问题描述】:
这个问题无法解释更多。
db/migrate/20140415150026_create_poll_answers.rb
class CreatePollAnswers < ActiveRecord::Migration
def change
create_table :poll_answers do |t|
t.string :content
t.integer :counter
t.boolean :instant_value
t.timestamps
end
end
end
数据库/模式
create_table "poll_answers", force: true do |t|
t.string "content"
t.integer "counter"
t.boolean "instant_value"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "poll_question_id"
end
我找到了答案,但我不确定它是否适用于 rails 4,我也不知道应该在哪里写!!!
add_column :Table_name, :colman_name, :data_type, :default => "default"
【问题讨论】:
-
你说的“灭柱”是什么意思?
-
对不起,我的意思是现有的
标签: ruby-on-rails sqlite ruby-on-rails-4