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
60
61
62
63
|
# File 'lib/migrate/20100512164608_create_offroad_tables.rb', line 2
def self.up
create_table :offroad_system_state do |t|
t.column :current_mirror_version, :integer
end
create_table :offroad_group_states do |t|
t.column :app_group_id, :integer, :null => false
t.column :group_being_destroyed, :boolean, :default => false, :null => false
t.column :group_locked, :boolean, :default => false, :null => false
t.column :confirmed_group_data_version, :integer, :null => false
t.column :confirmed_global_data_version, :integer, :null => false
t.column :last_installer_downloaded_at, :datetime
t.column :last_installation_at, :datetime
t.column :last_down_mirror_created_at, :datetime
t.column :last_down_mirror_loaded_at, :datetime
t.column :last_up_mirror_created_at, :datetime
t.column :last_up_mirror_loaded_at, :datetime
t.column :launcher_version, :integer
t.column :app_version, :integer
t.column :operating_system, :string, :default => "Unknown", :null => false
end
add_index :offroad_group_states, :app_group_id, :unique => true
add_index :offroad_group_states, :confirmed_global_data_version
create_table :offroad_model_states do |t|
t.column :app_model_name, :string, :null => false
end
add_index :offroad_model_states, :app_model_name, :unique => true
create_table :offroad_sendable_record_states do |t|
t.column :model_state_id, :integer, :null => false
t.column :local_record_id, :integer, :null => false
t.column :mirror_version, :integer, :default => 0, :null => false
t.column :deleted, :boolean, :default => false, :null => false
end
add_index :offroad_sendable_record_states, [:local_record_id, :model_state_id], :unique => true
add_index :offroad_sendable_record_states, [:model_state_id, :deleted, :mirror_version]
create_table :offroad_received_record_states do |t|
t.column :model_state_id, :integer, :null => false
t.column :group_state_id, :integer, :default => 0, :null => false t.column :local_record_id, :integer, :null => false
t.column :remote_record_id, :integer, :null => false
end
add_index :offroad_received_record_states, [:model_state_id, :group_state_id, :remote_record_id], :unique => true
add_index :offroad_received_record_states, [:model_state_id, :local_record_id], :unique => true
end
|