Description:
update options
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r615:1e667e9af902 - - 2 files changed: 17 inserted, 1 deleted

@@ -0,0 +1,16
1 + class AddConfigViewTest < ActiveRecord::Migration
2 + def up
3 + GraderConfiguration.create key: 'right.view_testcase', value_type: 'boolean', value:'true', description:'When true, any user can view/download test data'
4 + #uglily and dirtily and shamelessly check other config and inifialize
5 + GraderConfiguration.where(key: 'right.user_hall_of_fame').first_or_create(value_type: 'boolean', value: 'false',
6 + description: 'If true, any user can access hall of fame page.')
7 + GraderConfiguration.where(key: 'right.multiple_ip_login').first_or_create(value_type: 'boolean', value: 'false',
8 + description: 'When change from true to false, a user can login from the first IP they logged into afterward.')
9 + GraderConfiguration.where(key: 'right.user_view_submission').first_or_create(value_type: 'boolean', value: 'false',
10 + description: 'If true, any user can view submissions of every one.')
11 + end
12 +
13 + def down
14 + GraderConfiguration.where(key: 'right.view_testcase').destroy_all;
15 + end
16 + end
@@ -1,206 +1,206
1 # encoding: UTF-8
1 # encoding: UTF-8
2 # This file is auto-generated from the current state of the database. Instead
2 # This file is auto-generated from the current state of the database. Instead
3 # of editing this file, please use the migrations feature of Active Record to
3 # of editing this file, please use the migrations feature of Active Record to
4 # incrementally modify your database, and then regenerate this schema definition.
4 # incrementally modify your database, and then regenerate this schema definition.
5 #
5 #
6 # Note that this schema.rb definition is the authoritative source for your
6 # Note that this schema.rb definition is the authoritative source for your
7 # database schema. If you need to create the application database on another
7 # database schema. If you need to create the application database on another
8 # system, you should be using db:schema:load, not running all the migrations
8 # system, you should be using db:schema:load, not running all the migrations
9 # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9 # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10 # you'll amass, the slower it'll run and the greater likelihood for issues).
10 # you'll amass, the slower it'll run and the greater likelihood for issues).
11 #
11 #
12 # It's strongly recommended to check this file into your version control system.
12 # It's strongly recommended to check this file into your version control system.
13
13
14 - ActiveRecord::Schema.define(:version => 20161014091417) do
14 + ActiveRecord::Schema.define(:version => 20161031063337) do
15
15
16 create_table "announcements", :force => true do |t|
16 create_table "announcements", :force => true do |t|
17 t.string "author"
17 t.string "author"
18 t.text "body"
18 t.text "body"
19 t.boolean "published"
19 t.boolean "published"
20 t.datetime "created_at", :null => false
20 t.datetime "created_at", :null => false
21 t.datetime "updated_at", :null => false
21 t.datetime "updated_at", :null => false
22 t.boolean "frontpage", :default => false
22 t.boolean "frontpage", :default => false
23 t.boolean "contest_only", :default => false
23 t.boolean "contest_only", :default => false
24 t.string "title"
24 t.string "title"
25 t.string "notes"
25 t.string "notes"
26 end
26 end
27
27
28 create_table "contests", :force => true do |t|
28 create_table "contests", :force => true do |t|
29 t.string "title"
29 t.string "title"
30 t.boolean "enabled"
30 t.boolean "enabled"
31 t.datetime "created_at", :null => false
31 t.datetime "created_at", :null => false
32 t.datetime "updated_at", :null => false
32 t.datetime "updated_at", :null => false
33 t.string "name"
33 t.string "name"
34 end
34 end
35
35
36 create_table "contests_problems", :id => false, :force => true do |t|
36 create_table "contests_problems", :id => false, :force => true do |t|
37 t.integer "contest_id"
37 t.integer "contest_id"
38 t.integer "problem_id"
38 t.integer "problem_id"
39 end
39 end
40
40
41 create_table "contests_users", :id => false, :force => true do |t|
41 create_table "contests_users", :id => false, :force => true do |t|
42 t.integer "contest_id"
42 t.integer "contest_id"
43 t.integer "user_id"
43 t.integer "user_id"
44 end
44 end
45
45
46 create_table "countries", :force => true do |t|
46 create_table "countries", :force => true do |t|
47 t.string "name"
47 t.string "name"
48 t.datetime "created_at", :null => false
48 t.datetime "created_at", :null => false
49 t.datetime "updated_at", :null => false
49 t.datetime "updated_at", :null => false
50 end
50 end
51
51
52 create_table "descriptions", :force => true do |t|
52 create_table "descriptions", :force => true do |t|
53 t.text "body"
53 t.text "body"
54 t.boolean "markdowned"
54 t.boolean "markdowned"
55 t.datetime "created_at", :null => false
55 t.datetime "created_at", :null => false
56 t.datetime "updated_at", :null => false
56 t.datetime "updated_at", :null => false
57 end
57 end
58
58
59 create_table "grader_configurations", :force => true do |t|
59 create_table "grader_configurations", :force => true do |t|
60 t.string "key"
60 t.string "key"
61 t.string "value_type"
61 t.string "value_type"
62 t.string "value"
62 t.string "value"
63 t.datetime "created_at", :null => false
63 t.datetime "created_at", :null => false
64 t.datetime "updated_at", :null => false
64 t.datetime "updated_at", :null => false
65 t.text "description"
65 t.text "description"
66 end
66 end
67
67
68 create_table "grader_processes", :force => true do |t|
68 create_table "grader_processes", :force => true do |t|
69 t.string "host"
69 t.string "host"
70 t.integer "pid"
70 t.integer "pid"
71 t.string "mode"
71 t.string "mode"
72 t.boolean "active"
72 t.boolean "active"
73 t.datetime "created_at", :null => false
73 t.datetime "created_at", :null => false
74 t.datetime "updated_at", :null => false
74 t.datetime "updated_at", :null => false
75 t.integer "task_id"
75 t.integer "task_id"
76 t.string "task_type"
76 t.string "task_type"
77 t.boolean "terminated"
77 t.boolean "terminated"
78 end
78 end
79
79
80 add_index "grader_processes", ["host", "pid"], :name => "index_grader_processes_on_ip_and_pid"
80 add_index "grader_processes", ["host", "pid"], :name => "index_grader_processes_on_ip_and_pid"
81
81
82 create_table "heart_beats", :force => true do |t|
82 create_table "heart_beats", :force => true do |t|
83 t.integer "user_id"
83 t.integer "user_id"
84 t.string "ip_address"
84 t.string "ip_address"
85 t.datetime "created_at", :null => false
85 t.datetime "created_at", :null => false
86 t.datetime "updated_at", :null => false
86 t.datetime "updated_at", :null => false
87 t.string "status"
87 t.string "status"
88 end
88 end
89
89
90 add_index "heart_beats", ["updated_at"], :name => "index_heart_beats_on_updated_at"
90 add_index "heart_beats", ["updated_at"], :name => "index_heart_beats_on_updated_at"
91
91
92 create_table "languages", :force => true do |t|
92 create_table "languages", :force => true do |t|
93 t.string "name", :limit => 10
93 t.string "name", :limit => 10
94 t.string "pretty_name"
94 t.string "pretty_name"
95 t.string "ext", :limit => 10
95 t.string "ext", :limit => 10
96 t.string "common_ext"
96 t.string "common_ext"
97 end
97 end
98
98
99 create_table "logins", :force => true do |t|
99 create_table "logins", :force => true do |t|
100 t.integer "user_id"
100 t.integer "user_id"
101 t.string "ip_address"
101 t.string "ip_address"
102 t.datetime "created_at", :null => false
102 t.datetime "created_at", :null => false
103 t.datetime "updated_at", :null => false
103 t.datetime "updated_at", :null => false
104 end
104 end
105
105
106 create_table "messages", :force => true do |t|
106 create_table "messages", :force => true do |t|
107 t.integer "sender_id"
107 t.integer "sender_id"
108 t.integer "receiver_id"
108 t.integer "receiver_id"
109 t.integer "replying_message_id"
109 t.integer "replying_message_id"
110 t.text "body"
110 t.text "body"
111 t.boolean "replied"
111 t.boolean "replied"
112 t.datetime "created_at", :null => false
112 t.datetime "created_at", :null => false
113 t.datetime "updated_at", :null => false
113 t.datetime "updated_at", :null => false
114 end
114 end
115
115
116 create_table "problems", :force => true do |t|
116 create_table "problems", :force => true do |t|
117 t.string "name", :limit => 30
117 t.string "name", :limit => 30
118 t.string "full_name"
118 t.string "full_name"
119 t.integer "full_score"
119 t.integer "full_score"
120 t.date "date_added"
120 t.date "date_added"
121 t.boolean "available"
121 t.boolean "available"
122 t.string "url"
122 t.string "url"
123 t.integer "description_id"
123 t.integer "description_id"
124 t.boolean "test_allowed"
124 t.boolean "test_allowed"
125 t.boolean "output_only"
125 t.boolean "output_only"
126 t.string "description_filename"
126 t.string "description_filename"
127 end
127 end
128
128
129 create_table "rights", :force => true do |t|
129 create_table "rights", :force => true do |t|
130 t.string "name"
130 t.string "name"
131 t.string "controller"
131 t.string "controller"
132 t.string "action"
132 t.string "action"
133 end
133 end
134
134
135 create_table "rights_roles", :id => false, :force => true do |t|
135 create_table "rights_roles", :id => false, :force => true do |t|
136 t.integer "right_id"
136 t.integer "right_id"
137 t.integer "role_id"
137 t.integer "role_id"
138 end
138 end
139
139
140 add_index "rights_roles", ["role_id"], :name => "index_rights_roles_on_role_id"
140 add_index "rights_roles", ["role_id"], :name => "index_rights_roles_on_role_id"
141
141
142 create_table "roles", :force => true do |t|
142 create_table "roles", :force => true do |t|
143 t.string "name"
143 t.string "name"
144 end
144 end
145
145
146 create_table "roles_users", :id => false, :force => true do |t|
146 create_table "roles_users", :id => false, :force => true do |t|
147 t.integer "role_id"
147 t.integer "role_id"
148 t.integer "user_id"
148 t.integer "user_id"
149 end
149 end
150
150
151 add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id"
151 add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id"
152
152
153 create_table "sessions", :force => true do |t|
153 create_table "sessions", :force => true do |t|
154 t.string "session_id"
154 t.string "session_id"
155 t.text "data"
155 t.text "data"
156 t.datetime "updated_at"
156 t.datetime "updated_at"
157 end
157 end
158
158
159 add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
159 add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
160 add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
160 add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
161
161
162 create_table "sites", :force => true do |t|
162 create_table "sites", :force => true do |t|
163 t.string "name"
163 t.string "name"
164 t.boolean "started"
164 t.boolean "started"
165 t.datetime "start_time"
165 t.datetime "start_time"
166 t.datetime "created_at", :null => false
166 t.datetime "created_at", :null => false
167 t.datetime "updated_at", :null => false
167 t.datetime "updated_at", :null => false
168 t.integer "country_id"
168 t.integer "country_id"
169 t.string "password"
169 t.string "password"
170 end
170 end
171
171
172 create_table "submission_view_logs", :force => true do |t|
172 create_table "submission_view_logs", :force => true do |t|
173 t.integer "user_id"
173 t.integer "user_id"
174 t.integer "submission_id"
174 t.integer "submission_id"
175 t.datetime "created_at", :null => false
175 t.datetime "created_at", :null => false
176 t.datetime "updated_at", :null => false
176 t.datetime "updated_at", :null => false
177 end
177 end
178
178
179 create_table "submissions", :force => true do |t|
179 create_table "submissions", :force => true do |t|
180 t.integer "user_id"
180 t.integer "user_id"
181 t.integer "problem_id"
181 t.integer "problem_id"
182 t.integer "language_id"
182 t.integer "language_id"
183 t.text "source"
183 t.text "source"
184 t.binary "binary"
184 t.binary "binary"
185 t.datetime "submitted_at"
185 t.datetime "submitted_at"
186 t.datetime "compiled_at"
186 t.datetime "compiled_at"
187 t.text "compiler_message"
187 t.text "compiler_message"
188 t.datetime "graded_at"
188 t.datetime "graded_at"
189 t.integer "points"
189 t.integer "points"
190 t.text "grader_comment"
190 t.text "grader_comment"
191 t.integer "number"
191 t.integer "number"
192 t.string "source_filename"
192 t.string "source_filename"
193 t.float "max_runtime"
193 t.float "max_runtime"
194 t.integer "peak_memory"
194 t.integer "peak_memory"
195 t.integer "effective_code_length"
195 t.integer "effective_code_length"
196 t.string "ip_address"
196 t.string "ip_address"
197 end
197 end
198
198
199 add_index "submissions", ["user_id", "problem_id", "number"], :name => "index_submissions_on_user_id_and_problem_id_and_number", :unique => true
199 add_index "submissions", ["user_id", "problem_id", "number"], :name => "index_submissions_on_user_id_and_problem_id_and_number", :unique => true
200 add_index "submissions", ["user_id", "problem_id"], :name => "index_submissions_on_user_id_and_problem_id"
200 add_index "submissions", ["user_id", "problem_id"], :name => "index_submissions_on_user_id_and_problem_id"
201
201
202 create_table "tasks", :force => true do |t|
202 create_table "tasks", :force => true do |t|
203 t.integer "submission_id"
203 t.integer "submission_id"
204 t.datetime "created_at"
204 t.datetime "created_at"
205 t.integer "status"
205 t.integer "status"
206 t.datetime "updated_at"
206 t.datetime "updated_at"
You need to be logged in to leave comments. Login now