diff options
author | Jamis Buck <jamis@37signals.com> | 2005-07-27 17:06:22 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-07-27 17:06:22 +0000 |
commit | 369d0543380d302fb4b4fc30d4f6d52f07f9c0b6 (patch) | |
tree | 9af5bc70b2cf000b90c2182ffce88c64cd1c17b0 /activerecord/lib/active_record/connection_adapters | |
parent | 9fad3251d3d11f32fad01c820b6d1d72e2329976 (diff) | |
download | rails-369d0543380d302fb4b4fc30d4f6d52f07f9c0b6.tar.gz rails-369d0543380d302fb4b4fc30d4f6d52f07f9c0b6.tar.bz2 rails-369d0543380d302fb4b4fc30d4f6d52f07f9c0b6.zip |
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
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | 7 |
1 files changed, 2 insertions, 5 deletions
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 |