diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index ec2079d..d58609c 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,8 +1,8 @@ # Be sure to restart your server when you modify this file. -Scube::Application.config.session_store :cookie_store, :key => '_scube_session' +#Scube::Application.config.session_store :cookie_store, :key => '_scube_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the session table with "rails generate session_migration") -# Scube::Application.config.session_store :active_record_store +Scube::Application.config.session_store :active_record_store diff --git a/db/migrate/20110804225816_add_sessions_table.rb b/db/migrate/20110804225816_add_sessions_table.rb new file mode 100644 index 0000000..8e644d2 --- /dev/null +++ b/db/migrate/20110804225816_add_sessions_table.rb @@ -0,0 +1,16 @@ +class AddSessionsTable < ActiveRecord::Migration + def self.up + create_table :sessions do |t| + t.string :session_id, :null => false + t.text :data + t.timestamps + end + + add_index :sessions, :session_id + add_index :sessions, :updated_at + end + + def self.down + drop_table :sessions + end +end diff --git a/db/schema.rb b/db/schema.rb index e84458b..7ea3b43 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20110726101228) do +ActiveRecord::Schema.define(:version => 20110804225816) do create_table "playlists", :force => true do |t| t.string "name" @@ -18,6 +18,16 @@ ActiveRecord::Schema.define(:version => 20110726101228) do t.datetime "updated_at" end + create_table "sessions", :force => true do |t| + t.string "session_id", :null => false + t.text "data" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id" + add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at" + create_table "tracks", :force => true do |t| t.string "name" t.datetime "created_at"