From 369d0543380d302fb4b4fc30d4f6d52f07f9c0b6 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Wed, 27 Jul 2005 17:06:22 +0000 Subject: Fix create_table so that id column is implicitly added [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1949 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/active_record/connection_adapters/abstract_adapter.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'activerecord/lib/active_record/connection_adapters/abstract_adapter.rb') diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index 7a680c3101..532d582565 100755 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -384,7 +384,6 @@ module ActiveRecord create_sql << "#{name} (" create_sql << table_definition.to_sql create_sql << ") #{options[:options]}" - execute create_sql end @@ -518,9 +517,7 @@ module ActiveRecord end def primary_key(name) - return unless column = self[name] - column.type = native[:primary_key] - self + column(name, native[:primary_key]) end def [](name) @@ -529,7 +526,7 @@ module ActiveRecord def column(name, type, options = {}) column = self[name] || ColumnDefinition.new(@base, name, type) - column.limit = options[:limit] || native[type.to_sym][:limit] + column.limit = options[:limit] || native[type.to_sym][:limit] if options[:limit] or native[type.to_sym] column.default = options[:default] @columns << column unless @columns.include? column self -- cgit v1.2.3