From ef214ecc40f34006f88fc4b636dc3457f76deba6 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 10 Mar 2005 14:30:35 +0000 Subject: [PATCH] More incremental work on active schema for MySQL git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@885 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/active_record/connection_adapters/abstract_adapter.rb | 2 +- .../lib/active_record/connection_adapters/mysql_adapter.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index ba18bad504..cf7f07ba26 100755 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -359,7 +359,7 @@ module ActiveRecord def initialize_schema_information begin - execute "CREATE TABLE schema_info (version #{native_database_types[:integer]})" + execute "CREATE TABLE schema_info (version #{native_database_types[:integer][:name]}#{native_database_types[:integer][:limit]})" insert "INSERT INTO schema_info (version) VALUES(0)" rescue ActiveRecord::StatementInvalid # Schema has been intialized diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index 9537269260..fd730a12dc 100755 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -66,7 +66,7 @@ module ActiveRecord def native_database_types { - :primary_key => { :name => "int(11) DEFAULT NULL auto_increment PRIMARY KEY" }, + :primary_key => "int(11) DEFAULT NULL auto_increment PRIMARY KEY", :string => { :name => "varchar", :limit => 255 }, :text => { :name => "text" }, :integer => { :name => "int", :limit => 11 },