Class: AddSessionsTable

Inherits:
Sequel::Migration
  • Object
show all
Defined in:
lib/generators/templates/session_migration/schema/migrations/%version%_sessions.rb

Instance Method Summary collapse

Instance Method Details

#downObject



12
13
14
# File 'lib/generators/templates/session_migration/schema/migrations/%version%_sessions.rb', line 12

def down
  drop_table :sessions
end

#upObject



3
4
5
6
7
8
9
10
# File 'lib/generators/templates/session_migration/schema/migrations/%version%_sessions.rb', line 3

def up
  create_table :sessions do
    primary_key :id
    varchar     :session_id, :size => 64, :unique => true
    timestamp   :created_at
    text        :data
  end
end