https://thinkwhere.wordpress.com/2009/05/09/adding-a-primary-key-id-to-table-in-rails/
def self.up
add_column :table_name, :id, :primary_key
end
def self.down
remove_column :table_name, :id
end
https://thinkwhere.wordpress.com/2009/05/09/adding-a-primary-key-id-to-table-in-rails/
def self.up
add_column :table_name, :id, :primary_key
end
def self.down
remove_column :table_name, :id
end
本文标题:Ruby ActiveRecord 增加primary key
本文链接:https://www.haomeiwen.com/subject/gmxrgctx.html
网友评论