2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/scavenger_hunt/lib/generators/scavenger_hunt/install/templates/create_scavenger_hunt.rb', line 2
def change
create_table :scavenger_hunt_players do |t|
t.string :email
t.string :name
t.string :user_agent, null: false
t.inet :ip, null: false
t.timestamps
end
create_table :scavenger_hunt_locations do |t|
t.belongs_to :organization, null: false
t.integer :position, null: false
t.string :tint, null: false
end
create_table :scavenger_hunt_games do |t|
t.belongs_to :location, null: false
t.belongs_to :player, null: false
t.timestamp :ended_at
t.timestamps
end
create_table :scavenger_hunt_clues do |t|
t.belongs_to :game, null: false
t.belongs_to :representation, null: false
t.integer :position, null: false
t.timestamp :started_at
t.timestamp :ended_at
t.timestamps
end
create_table :scavenger_hunt_hints do |t|
t.belongs_to :clue, null: false
t.belongs_to :representation, null: false
t.integer :position, null: false
t.timestamp :used_at
t.timestamps
end
create_table :scavenger_hunt_answers do |t|
t.belongs_to :clue, null: false
t.belongs_to :resource, null: false
t.boolean :is_correct, null: false
t.timestamps
end
create_table :scavenger_hunt_survey_questions do |t|
t.integer :position, null: false
t.string :text, null: false
t.json :options
end
create_table :scavenger_hunt_survey_answers do |t|
t.belongs_to :player, null: false
t.belongs_to :survey_question, null: false
t.string :answer
end
end
|