From 72cead251b6a2344f25c9aa7db540a0252bac0bf Mon Sep 17 00:00:00 2001 From: Kensuke Kaneko Date: Thu, 21 Jan 2010 00:23:17 +0900 Subject: [PATCH] Add session table --- .../db/migrate/20100120152145_create_sessions.rb | 16 ++++++++++++++++ depot/db/schema.rb | 12 +++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 depot/db/migrate/20100120152145_create_sessions.rb diff --git a/depot/db/migrate/20100120152145_create_sessions.rb b/depot/db/migrate/20100120152145_create_sessions.rb new file mode 100644 index 0000000..4ccc353 --- /dev/null +++ b/depot/db/migrate/20100120152145_create_sessions.rb @@ -0,0 +1,16 @@ +class CreateSessions < 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/depot/db/schema.rb b/depot/db/schema.rb index ad4fb0c..14d3c52 100644 --- a/depot/db/schema.rb +++ b/depot/db/schema.rb @@ -9,7 +9,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20100119101420) do +ActiveRecord::Schema.define(:version => 20100120152145) do create_table "products", :force => true do |t| t.string "title" @@ -20,4 +20,14 @@ t.decimal "price", :precision => 8, :scale => 2, :default => 0.0 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" + end