Description:
update schema
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r640:6287684fa8d9 - - 1 file changed: 148 inserted, 137 deleted
@@ -14,257 +14,268 | |||
|
14 | 14 | ActiveRecord::Schema.define(version: 20170124024527) do |
|
15 | 15 | |
|
16 | 16 | create_table "announcements", force: :cascade do |t| |
|
17 | - t.string "author" | |
|
18 | - t.text "body" | |
|
17 | + t.string "author", limit: 255 | |
|
18 | + t.text "body", limit: 16777215 | |
|
19 | 19 | t.boolean "published" |
|
20 | - t.datetime "created_at", null: false | |
|
21 | - t.datetime "updated_at", null: false | |
|
22 | - t.boolean "frontpage", default: false | |
|
23 | - t.boolean "contest_only", default: false | |
|
24 | - t.string "title" | |
|
25 | - t.string "notes" | |
|
20 | + t.datetime "created_at", null: false | |
|
21 | + t.datetime "updated_at", null: false | |
|
22 | + t.boolean "frontpage", default: false | |
|
23 | + t.boolean "contest_only", default: false | |
|
24 | + t.string "title", limit: 255 | |
|
25 | + t.string "notes", limit: 255 | |
|
26 | 26 | end |
|
27 | 27 | |
|
28 | 28 | create_table "contests", force: :cascade do |t| |
|
29 | - t.string "title" | |
|
29 | + t.string "title", limit: 255 | |
|
30 | 30 | t.boolean "enabled" |
|
31 | - t.datetime "created_at", null: false | |
|
32 | - t.datetime "updated_at", null: false | |
|
33 | - t.string "name" | |
|
31 | + t.datetime "created_at", null: false | |
|
32 | + t.datetime "updated_at", null: false | |
|
33 | + t.string "name", limit: 255 | |
|
34 | 34 | end |
|
35 | 35 | |
|
36 | 36 | create_table "contests_problems", id: false, force: :cascade do |t| |
|
37 | - t.integer "contest_id" | |
|
38 | - t.integer "problem_id" | |
|
37 | + t.integer "contest_id", limit: 4 | |
|
38 | + t.integer "problem_id", limit: 4 | |
|
39 | 39 | end |
|
40 | 40 | |
|
41 | 41 | create_table "contests_users", id: false, force: :cascade do |t| |
|
42 | - t.integer "contest_id" | |
|
43 | - t.integer "user_id" | |
|
42 | + t.integer "contest_id", limit: 4 | |
|
43 | + t.integer "user_id", limit: 4 | |
|
44 | 44 | end |
|
45 | 45 | |
|
46 | 46 | create_table "countries", force: :cascade do |t| |
|
47 | - t.string "name" | |
|
48 | - t.datetime "created_at", null: false | |
|
49 | - t.datetime "updated_at", null: false | |
|
47 | + t.string "name", limit: 255 | |
|
48 | + t.datetime "created_at", null: false | |
|
49 | + t.datetime "updated_at", null: false | |
|
50 | 50 | end |
|
51 | 51 | |
|
52 | 52 | create_table "descriptions", force: :cascade do |t| |
|
53 | - t.text "body" | |
|
53 | + t.text "body", limit: 16777215 | |
|
54 | 54 | t.boolean "markdowned" |
|
55 | - t.datetime "created_at", null: false | |
|
56 | - t.datetime "updated_at", null: false | |
|
55 | + t.datetime "created_at", null: false | |
|
56 | + t.datetime "updated_at", null: false | |
|
57 | 57 | end |
|
58 | 58 | |
|
59 | 59 | create_table "grader_configurations", force: :cascade do |t| |
|
60 | - t.string "key" | |
|
61 | - t.string "value_type" | |
|
62 | - t.string "value" | |
|
63 | - t.datetime "created_at", null: false | |
|
64 | - t.datetime "updated_at", null: false | |
|
65 | - t.text "description" | |
|
60 | + t.string "key", limit: 255 | |
|
61 | + t.string "value_type", limit: 255 | |
|
62 | + t.string "value", limit: 255 | |
|
63 | + t.datetime "created_at", null: false | |
|
64 | + t.datetime "updated_at", null: false | |
|
65 | + t.text "description", limit: 16777215 | |
|
66 | 66 | end |
|
67 | 67 | |
|
68 | 68 | create_table "grader_processes", force: :cascade do |t| |
|
69 | - t.string "host" | |
|
70 | - t.integer "pid" | |
|
71 | - t.string "mode" | |
|
69 | + t.string "host", limit: 255 | |
|
70 | + t.integer "pid", limit: 4 | |
|
71 | + t.string "mode", limit: 255 | |
|
72 | 72 | t.boolean "active" |
|
73 | - t.datetime "created_at", null: false | |
|
74 | - t.datetime "updated_at", null: false | |
|
75 | - t.integer "task_id" | |
|
76 | - t.string "task_type" | |
|
73 | + t.datetime "created_at", null: false | |
|
74 | + t.datetime "updated_at", null: false | |
|
75 | + t.integer "task_id", limit: 4 | |
|
76 | + t.string "task_type", limit: 255 | |
|
77 | 77 | t.boolean "terminated" |
|
78 | 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", using: :btree | |
|
81 | 81 | |
|
82 | 82 | create_table "heart_beats", force: :cascade do |t| |
|
83 | - t.integer "user_id" | |
|
84 | - t.string "ip_address" | |
|
85 | - t.datetime "created_at", null: false | |
|
86 | - t.datetime "updated_at", null: false | |
|
87 | - t.string "status" | |
|
83 | + t.integer "user_id", limit: 4 | |
|
84 | + t.string "ip_address", limit: 255 | |
|
85 | + t.datetime "created_at", null: false | |
|
86 | + t.datetime "updated_at", null: false | |
|
87 | + t.string "status", limit: 255 | |
|
88 | 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", using: :btree | |
|
91 | 91 | |
|
92 | 92 | create_table "languages", force: :cascade do |t| |
|
93 | 93 | t.string "name", limit: 10 |
|
94 | - t.string "pretty_name" | |
|
94 | + t.string "pretty_name", limit: 255 | |
|
95 | 95 | t.string "ext", limit: 10 |
|
96 | - t.string "common_ext" | |
|
96 | + t.string "common_ext", limit: 255 | |
|
97 | 97 | end |
|
98 | 98 | |
|
99 | 99 | create_table "logins", force: :cascade do |t| |
|
100 | - t.integer "user_id" | |
|
101 | - t.string "ip_address" | |
|
102 | - t.datetime "created_at", null: false | |
|
103 | - t.datetime "updated_at", null: false | |
|
100 | + t.integer "user_id", limit: 4 | |
|
101 | + t.string "ip_address", limit: 255 | |
|
102 | + t.datetime "created_at", null: false | |
|
103 | + t.datetime "updated_at", null: false | |
|
104 | 104 | end |
|
105 | 105 | |
|
106 | 106 | create_table "messages", force: :cascade do |t| |
|
107 | - t.integer "sender_id" | |
|
108 | - t.integer "receiver_id" | |
|
109 | - t.integer "replying_message_id" | |
|
110 | - t.text "body" | |
|
107 | + t.integer "sender_id", limit: 4 | |
|
108 | + t.integer "receiver_id", limit: 4 | |
|
109 | + t.integer "replying_message_id", limit: 4 | |
|
110 | + t.text "body", limit: 16777215 | |
|
111 | 111 | t.boolean "replied" |
|
112 | - t.datetime "created_at", null: false | |
|
113 | - t.datetime "updated_at", null: false | |
|
112 | + t.datetime "created_at", null: false | |
|
113 | + t.datetime "updated_at", null: false | |
|
114 | 114 | end |
|
115 | 115 | |
|
116 | - # Could not dump table "problems" because of following NoMethodError | |
|
117 | - # undefined method `[]' for nil:NilClass | |
|
116 | + create_table "problems", force: :cascade do |t| | |
|
117 | + t.string "name", limit: 30 | |
|
118 | + t.string "full_name", limit: 255 | |
|
119 | + t.integer "full_score", limit: 4 | |
|
120 | + t.date "date_added" | |
|
121 | + t.boolean "available" | |
|
122 | + t.string "url", limit: 255 | |
|
123 | + t.integer "description_id", limit: 4 | |
|
124 | + t.boolean "test_allowed" | |
|
125 | + t.boolean "output_only" | |
|
126 | + t.string "description_filename", limit: 255 | |
|
127 | + t.boolean "view_testcase" | |
|
128 | + end | |
|
118 | 129 | |
|
119 | 130 | create_table "rights", force: :cascade do |t| |
|
120 | - t.string "name" | |
|
121 | - t.string "controller" | |
|
122 | - t.string "action" | |
|
131 | + t.string "name", limit: 255 | |
|
132 | + t.string "controller", limit: 255 | |
|
133 | + t.string "action", limit: 255 | |
|
123 | 134 | end |
|
124 | 135 | |
|
125 | 136 | create_table "rights_roles", id: false, force: :cascade do |t| |
|
126 | - t.integer "right_id" | |
|
127 | - t.integer "role_id" | |
|
137 | + t.integer "right_id", limit: 4 | |
|
138 | + t.integer "role_id", limit: 4 | |
|
128 | 139 | end |
|
129 | 140 | |
|
130 | - add_index "rights_roles", ["role_id"], name: "index_rights_roles_on_role_id" | |
|
141 | + add_index "rights_roles", ["role_id"], name: "index_rights_roles_on_role_id", using: :btree | |
|
131 | 142 | |
|
132 | 143 | create_table "roles", force: :cascade do |t| |
|
133 | - t.string "name" | |
|
144 | + t.string "name", limit: 255 | |
|
134 | 145 | end |
|
135 | 146 | |
|
136 | 147 | create_table "roles_users", id: false, force: :cascade do |t| |
|
137 | - t.integer "role_id" | |
|
138 | - t.integer "user_id" | |
|
148 | + t.integer "role_id", limit: 4 | |
|
149 | + t.integer "user_id", limit: 4 | |
|
139 | 150 | end |
|
140 | 151 | |
|
141 | - add_index "roles_users", ["user_id"], name: "index_roles_users_on_user_id" | |
|
152 | + add_index "roles_users", ["user_id"], name: "index_roles_users_on_user_id", using: :btree | |
|
142 | 153 | |
|
143 | 154 | create_table "sessions", force: :cascade do |t| |
|
144 | - t.string "session_id" | |
|
145 | - t.text "data" | |
|
155 | + t.string "session_id", limit: 255 | |
|
156 | + t.text "data", limit: 16777215 | |
|
146 | 157 | t.datetime "updated_at" |
|
147 | 158 | end |
|
148 | 159 | |
|
149 | - add_index "sessions", ["session_id"], name: "index_sessions_on_session_id" | |
|
150 | - add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at" | |
|
160 | + add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", using: :btree | |
|
161 | + add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree | |
|
151 | 162 | |
|
152 | 163 | create_table "sites", force: :cascade do |t| |
|
153 | - t.string "name" | |
|
164 | + t.string "name", limit: 255 | |
|
154 | 165 | t.boolean "started" |
|
155 | 166 | t.datetime "start_time" |
|
156 | - t.datetime "created_at", null: false | |
|
157 | - t.datetime "updated_at", null: false | |
|
158 | - t.integer "country_id" | |
|
159 | - t.string "password" | |
|
167 | + t.datetime "created_at", null: false | |
|
168 | + t.datetime "updated_at", null: false | |
|
169 | + t.integer "country_id", limit: 4 | |
|
170 | + t.string "password", limit: 255 | |
|
160 | 171 | end |
|
161 | 172 | |
|
162 | 173 | create_table "submission_view_logs", force: :cascade do |t| |
|
163 | - t.integer "user_id" | |
|
164 | - t.integer "submission_id" | |
|
165 | - t.datetime "created_at", null: false | |
|
166 | - t.datetime "updated_at", null: false | |
|
174 | + t.integer "user_id", limit: 4 | |
|
175 | + t.integer "submission_id", limit: 4 | |
|
176 | + t.datetime "created_at", null: false | |
|
177 | + t.datetime "updated_at", null: false | |
|
167 | 178 | end |
|
168 | 179 | |
|
169 | 180 | create_table "submissions", force: :cascade do |t| |
|
170 | - t.integer "user_id" | |
|
171 | - t.integer "problem_id" | |
|
172 | - t.integer "language_id" | |
|
173 | - t.text "source" | |
|
174 | - t.binary "binary" | |
|
181 | + t.integer "user_id", limit: 4 | |
|
182 | + t.integer "problem_id", limit: 4 | |
|
183 | + t.integer "language_id", limit: 4 | |
|
184 | + t.text "source", limit: 16777215 | |
|
185 | + t.binary "binary", limit: 65535 | |
|
175 | 186 | t.datetime "submitted_at" |
|
176 | 187 | t.datetime "compiled_at" |
|
177 | - t.text "compiler_message" | |
|
188 | + t.text "compiler_message", limit: 16777215 | |
|
178 | 189 | t.datetime "graded_at" |
|
179 | - t.integer "points" | |
|
180 | - t.text "grader_comment" | |
|
181 | - t.integer "number" | |
|
182 | - t.string "source_filename" | |
|
183 | - t.float "max_runtime" | |
|
184 | - t.integer "peak_memory" | |
|
185 | - t.integer "effective_code_length" | |
|
186 | - t.string "ip_address" | |
|
190 | + t.integer "points", limit: 4 | |
|
191 | + t.text "grader_comment", limit: 16777215 | |
|
192 | + t.integer "number", limit: 4 | |
|
193 | + t.string "source_filename", limit: 255 | |
|
194 | + t.float "max_runtime", limit: 24 | |
|
195 | + t.integer "peak_memory", limit: 4 | |
|
196 | + t.integer "effective_code_length", limit: 4 | |
|
197 | + t.string "ip_address", limit: 255 | |
|
187 | 198 | end |
|
188 | 199 | |
|
189 | - add_index "submissions", ["user_id", "problem_id", "number"], name: "index_submissions_on_user_id_and_problem_id_and_number", unique: true | |
|
190 | - add_index "submissions", ["user_id", "problem_id"], name: "index_submissions_on_user_id_and_problem_id" | |
|
200 | + add_index "submissions", ["user_id", "problem_id", "number"], name: "index_submissions_on_user_id_and_problem_id_and_number", unique: true, using: :btree | |
|
201 | + add_index "submissions", ["user_id", "problem_id"], name: "index_submissions_on_user_id_and_problem_id", using: :btree | |
|
191 | 202 | |
|
192 | 203 | create_table "tasks", force: :cascade do |t| |
|
193 | - t.integer "submission_id" | |
|
204 | + t.integer "submission_id", limit: 4 | |
|
194 | 205 | t.datetime "created_at" |
|
195 | - t.integer "status" | |
|
206 | + t.integer "status", limit: 4 | |
|
196 | 207 | t.datetime "updated_at" |
|
197 | 208 | end |
|
198 | 209 | |
|
199 | 210 | create_table "test_pairs", force: :cascade do |t| |
|
200 | - t.integer "problem_id" | |
|
201 |
- t.text "input", limit: |
|
|
202 |
- t.text "solution", limit: |
|
|
203 | - t.datetime "created_at", null: false | |
|
204 | - t.datetime "updated_at", null: false | |
|
211 | + t.integer "problem_id", limit: 4 | |
|
212 | + t.text "input", limit: 4294967295 | |
|
213 | + t.text "solution", limit: 4294967295 | |
|
214 | + t.datetime "created_at", null: false | |
|
215 | + t.datetime "updated_at", null: false | |
|
205 | 216 | end |
|
206 | 217 | |
|
207 | 218 | create_table "test_requests", force: :cascade do |t| |
|
208 | - t.integer "user_id" | |
|
209 | - t.integer "problem_id" | |
|
210 | - t.integer "submission_id" | |
|
211 | - t.string "input_file_name" | |
|
212 | - t.string "output_file_name" | |
|
213 | - t.string "running_stat" | |
|
214 | - t.integer "status" | |
|
215 | - t.datetime "updated_at", null: false | |
|
219 | + t.integer "user_id", limit: 4 | |
|
220 | + t.integer "problem_id", limit: 4 | |
|
221 | + t.integer "submission_id", limit: 4 | |
|
222 | + t.string "input_file_name", limit: 255 | |
|
223 | + t.string "output_file_name", limit: 255 | |
|
224 | + t.string "running_stat", limit: 255 | |
|
225 | + t.integer "status", limit: 4 | |
|
226 | + t.datetime "updated_at", null: false | |
|
216 | 227 | t.datetime "submitted_at" |
|
217 | 228 | t.datetime "compiled_at" |
|
218 | - t.text "compiler_message" | |
|
229 | + t.text "compiler_message", limit: 16777215 | |
|
219 | 230 | t.datetime "graded_at" |
|
220 | - t.string "grader_comment" | |
|
221 | - t.datetime "created_at", null: false | |
|
222 | - t.float "running_time" | |
|
223 | - t.string "exit_status" | |
|
224 | - t.integer "memory_usage" | |
|
231 | + t.string "grader_comment", limit: 255 | |
|
232 | + t.datetime "created_at", null: false | |
|
233 | + t.float "running_time", limit: 24 | |
|
234 | + t.string "exit_status", limit: 255 | |
|
235 | + t.integer "memory_usage", limit: 4 | |
|
225 | 236 | end |
|
226 | 237 | |
|
227 | - add_index "test_requests", ["user_id", "problem_id"], name: "index_test_requests_on_user_id_and_problem_id" | |
|
238 | + add_index "test_requests", ["user_id", "problem_id"], name: "index_test_requests_on_user_id_and_problem_id", using: :btree | |
|
228 | 239 | |
|
229 | 240 | create_table "testcases", force: :cascade do |t| |
|
230 | - t.integer "problem_id" | |
|
231 | - t.integer "num" | |
|
232 | - t.integer "group" | |
|
233 | - t.integer "score" | |
|
241 | + t.integer "problem_id", limit: 4 | |
|
242 | + t.integer "num", limit: 4 | |
|
243 | + t.integer "group", limit: 4 | |
|
244 | + t.integer "score", limit: 4 | |
|
234 | 245 | t.text "input", limit: 4294967295 |
|
235 | 246 | t.text "sol", limit: 4294967295 |
|
236 | 247 | t.datetime "created_at", null: false |
|
237 | 248 | t.datetime "updated_at", null: false |
|
238 | 249 | end |
|
239 | 250 | |
|
240 | - add_index "testcases", ["problem_id"], name: "index_testcases_on_problem_id" | |
|
251 | + add_index "testcases", ["problem_id"], name: "index_testcases_on_problem_id", using: :btree | |
|
241 | 252 | |
|
242 | 253 | create_table "user_contest_stats", force: :cascade do |t| |
|
243 | - t.integer "user_id" | |
|
254 | + t.integer "user_id", limit: 4 | |
|
244 | 255 | t.datetime "started_at" |
|
245 | - t.datetime "created_at", null: false | |
|
246 | - t.datetime "updated_at", null: false | |
|
256 | + t.datetime "created_at", null: false | |
|
257 | + t.datetime "updated_at", null: false | |
|
247 | 258 | t.boolean "forced_logout" |
|
248 | 259 | end |
|
249 | 260 | |
|
250 | 261 | create_table "users", force: :cascade do |t| |
|
251 | 262 | t.string "login", limit: 50 |
|
252 | - t.string "full_name" | |
|
253 | - t.string "hashed_password" | |
|
263 | + t.string "full_name", limit: 255 | |
|
264 | + t.string "hashed_password", limit: 255 | |
|
254 | 265 | t.string "salt", limit: 5 |
|
255 | - t.string "alias" | |
|
256 | - t.string "email" | |
|
257 | - t.integer "site_id" | |
|
258 | - t.integer "country_id" | |
|
259 | - t.boolean "activated", default: false | |
|
266 | + t.string "alias", limit: 255 | |
|
267 | + t.string "email", limit: 255 | |
|
268 | + t.integer "site_id", limit: 4 | |
|
269 | + t.integer "country_id", limit: 4 | |
|
270 | + t.boolean "activated", default: false | |
|
260 | 271 | t.datetime "created_at" |
|
261 | 272 | t.datetime "updated_at" |
|
262 | - t.boolean "enabled", default: true | |
|
263 | - t.string "remark" | |
|
264 | - t.string "last_ip" | |
|
265 | - t.string "section" | |
|
273 | + t.string "section", limit: 255 | |
|
274 | + t.boolean "enabled", default: true | |
|
275 | + t.string "remark", limit: 255 | |
|
276 | + t.string "last_ip", limit: 255 | |
|
266 | 277 | end |
|
267 | 278 | |
|
268 | - add_index "users", ["login"], name: "index_users_on_login", unique: true | |
|
279 | + add_index "users", ["login"], name: "index_users_on_login", unique: true, using: :btree | |
|
269 | 280 | |
|
270 | 281 | end |
You need to be logged in to leave comments.
Login now