]> git.openstreetmap.org Git - rails.git/commitdiff
Add migration to create session table in the database.
authorTom Hughes <tom@compton.nu>
Mon, 30 Jul 2007 22:59:20 +0000 (22:59 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 30 Jul 2007 22:59:20 +0000 (22:59 +0000)
db/migrate/003_sql_session_store_setup.rb [new file with mode: 0644]

diff --git a/db/migrate/003_sql_session_store_setup.rb b/db/migrate/003_sql_session_store_setup.rb
new file mode 100644 (file)
index 0000000..7b1c754
--- /dev/null
@@ -0,0 +1,15 @@
+class SqlSessionStoreSetup < ActiveRecord::Migration
+  def self.up
+    create_table "sessions", :options => "ENGINE=InnoDB" do |t|
+      t.column "session_id", :string
+      t.column "data",       :text
+      t.column "created_at", :timestamp
+      t.column "updated_at", :timestamp
+    end
+    add_index "sessions", ["session_id"], :name => "sessions_session_id_idx", :unique => true
+  end
+
+  def self.down
+    drop_table "sessions"
+  end
+end