From: Andy Allan Date: Sat, 8 Nov 2008 17:39:16 +0000 (+0000) Subject: last of the auto_increments removed from the migrations X-Git-Tag: live~7601^2~196 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/c19d1b406b149040a37ef22f4f14eeddc29cf0ea last of the auto_increments removed from the migrations --- diff --git a/db/migrate/001_create_osm_db.rb b/db/migrate/001_create_osm_db.rb index fdced3e1b..998e12951 100644 --- a/db/migrate/001_create_osm_db.rb +++ b/db/migrate/001_create_osm_db.rb @@ -199,7 +199,7 @@ class CreateOsmDb < ActiveRecord::Migration add_primary_key "way_segments", ["id", "version", "sequence_id"] - change_column "way_segments", "sequence_id", :bigint, :limit => 11, :null => false, :options => "AUTO_INCREMENT" + change_column "way_segments", "sequence_id", :bigint_auto_11 create_table "way_tags", myisam_table do |t| t.column "id", :bigint, :limit => 64, :default => 0, :null => false @@ -221,7 +221,7 @@ class CreateOsmDb < ActiveRecord::Migration add_primary_key "ways", ["id", "version"] add_index "ways", ["id"], :name => "ways_id_version_idx" - change_column "ways", "version", :bigint, :limit => 20, :null => false, :options => "AUTO_INCREMENT" + change_column "ways", "version", :bigint_auto_20 end def self.down diff --git a/db/migrate/007_add_relations.rb b/db/migrate/007_add_relations.rb index 5dcdeb28d..dea777d5d 100644 --- a/db/migrate/007_add_relations.rb +++ b/db/migrate/007_add_relations.rb @@ -65,7 +65,7 @@ class AddRelations < ActiveRecord::Migration add_primary_key "relations", ["id", "version"] add_index "relations", ["timestamp"], :name => "relations_timestamp_idx" - change_column "relations", "version", :bigint, :limit => 20, :null => false, :options => "AUTO_INCREMENT" + change_column "relations", "version", :bigint_auto_20 end diff --git a/lib/migrate.rb b/lib/migrate.rb index 782436af3..77bc93646 100644 --- a/lib/migrate.rb +++ b/lib/migrate.rb @@ -47,6 +47,8 @@ module ActiveRecord 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" } + types[:bigint_auto_11] = { :name => "bigint(11) DEFAULT NULL auto_increment" } + types[:bigint_auto_20] = { :name => "bigint(20) DEFAULT NULL auto_increment" } types end