Credits to http://moeffju.net/blog/using-bigint-columns-in-rails-migrations
class CreateDemo < ActiveRecord::Migration
def self.up
create_table :demo, :id => false do |t|
t.integer :id, :limit => 8
end
end
end
- See the option
:id => false
which disables the automatic creation of the id field
- The
t.integer :id, :limit => 8
line will produce a 64 bit integer field
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…