diff options
author | Raimonds Simanovskis <raimonds.simanovskis@gmail.com> | 2010-08-17 06:01:01 +0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-16 15:21:58 -0700 |
commit | c7dd49eb2a319260e8a2a69104ea2323dbfed5d9 (patch) | |
tree | 1e411711177daf744494a4488f83aa0ae1fc8637 | |
parent | 4e3d220da3938c63df4ff44215a8eb1a93335294 (diff) | |
download | rails-c7dd49eb2a319260e8a2a69104ea2323dbfed5d9.tar.gz rails-c7dd49eb2a319260e8a2a69104ea2323dbfed5d9.tar.bz2 rails-c7dd49eb2a319260e8a2a69104ea2323dbfed5d9.zip |
Replaced hardcoded SessionStore table creation SQL with calls to ActiveRecord adapter migration methods
Otherwise hardcoded table creation SQL was failing on Oracle database
-rw-r--r-- | activerecord/lib/active_record/session_store.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/session_store.rb b/activerecord/lib/active_record/session_store.rb index bd3be93abb..01cc14b8d6 100644 --- a/activerecord/lib/active_record/session_store.rb +++ b/activerecord/lib/active_record/session_store.rb @@ -59,17 +59,15 @@ module ActiveRecord end def drop_table! - connection.execute "DROP TABLE #{table_name}" + connection.drop_table table_name end def create_table! - connection.execute <<-end_sql - CREATE TABLE #{table_name} ( - id #{connection.type_to_sql(:primary_key)}, - #{connection.quote_column_name(session_id_column)} VARCHAR(255) UNIQUE, - #{connection.quote_column_name(data_column_name)} TEXT - ) - end_sql + connection.create_table(table_name) do |t| + t.string session_id_column, :limit => 255 + t.text data_column_name + end + connection.add_index table_name, session_id_column, :unique => true end end |