mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Replaced hardcoded SessionStore table creation SQL with calls to ActiveRecord adapter migration methods
Otherwise hardcoded table creation SQL was failing on Oracle database
This commit is contained in:
committed by
Aaron Patterson
parent
4e3d220da3
commit
c7dd49eb2a
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user