Class: CreateResponseSets

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/surveyor/templates/db/migrate/create_response_sets.rb

Class Method Summary collapse

Class Method Details

.downObject



20
21
22
# File 'lib/generators/surveyor/templates/db/migrate/create_response_sets.rb', line 20

def self.down
  drop_table :response_sets
end

.upObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/generators/surveyor/templates/db/migrate/create_response_sets.rb', line 3

def self.up
  create_table :response_sets do |t|
    # Context
    t.integer :user_id
    t.integer :survey_id

    # Content
    t.string :access_code #unique id for the object used in urls

    # Expiry
    t.datetime :started_at
    t.datetime :completed_at

    t.timestamps
  end
end