class CreateAcls < ActiveRecord::Migration
def self.up
create_table "acls", myisam_table do |t|
- t.column "id", :integer, :null => false
- t.column "address", :integer, :null => false
- t.column "netmask", :integer, :null => false
- t.column "k", :string, :null => false
+ t.column "id", :integer_pk, :null => false
+ t.column "address", :integer, :null => false
+ t.column "netmask", :integer, :null => false
+ t.column "k", :string, :null => false
t.column "v", :string
end
- add_primary_key "acls", ["id"]
add_index "acls", ["k"], :name => "acls_k_idx"
- change_column "acls", "id", :integer, :null => false, :options => "AUTO_INCREMENT"
change_column "acls", "address", :integer, :null => false, :unsigned => true
change_column "acls", "netmask", :integer, :null => false, :unsigned => true
end
types = old_native_database_types
types[:bigint] = { :name => "bigint", :limit => 20 }
types[:double] = { :name => "double" }
+ types[:integer_pk] = { :name => "integer DEFAULT NULL auto_increment PRIMARY KEY" }
types[:bigint_pk] = { :name => "bigint(20) DEFAULT NULL auto_increment PRIMARY KEY" }
types[:bigint_pk_64] = { :name => "bigint(64) DEFAULT NULL auto_increment PRIMARY KEY" }
types[:bigint_auto_64] = { :name => "bigint(64) DEFAULT NULL auto_increment" }
def native_database_types
types = old_native_database_types
types[:double] = { :name => "double precision" }
+ types[:integer_pk] = { :name => "serial PRIMARY KEY" }
types[:bigint_pk] = { :name => "bigserial PRIMARY KEY" }
types[:bigint_pk_64] = { :name => "bigserial PRIMARY KEY" }
types[:bigint_auto_64] = { :name => "bigint" } #fixme: need autoincrement?