Skip to content

Commit 9c26013

Browse files
committed
Fix memory fields overflow
1 parent 2bba2e0 commit 9c26013

File tree

9 files changed

+35
-23
lines changed

9 files changed

+35
-23
lines changed

app/models/old_submission.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# problem_id :bigint
88
# result :string(255)
99
# score :decimal(18, 6)
10-
# total_time :integer
11-
# total_memory :integer
10+
# total_time :bigint
11+
# total_memory :bigint
1212
# created_at :datetime not null
1313
# updated_at :datetime not null
1414
#

app/models/old_submission_testdata_result.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# position :integer
88
# result :string(255)
99
# score :decimal(18, 6)
10-
# time :integer
11-
# rss :integer
10+
# time :bigint
11+
# rss :bigint
1212
# created_at :datetime not null
1313
# updated_at :datetime not null
1414
#

app/models/submission.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# problem_id :bigint default(0)
1111
# user_id :bigint default(0)
1212
# contest_id :bigint
13-
# total_time :integer
14-
# total_memory :integer
13+
# total_time :bigint
14+
# total_memory :bigint
1515
# message :text(16777215)
1616
# compiler_id :bigint not null
1717
# code_length :bigint default(0), not null

app/models/submission_testdata_result.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
# position :integer
88
# result :string(255)
99
# time :decimal(12, 3)
10-
# rss :integer
10+
# rss :bigint
1111
# score :decimal(18, 6)
1212
# created_at :datetime not null
1313
# updated_at :datetime not null
14-
# vss :integer
14+
# vss :bigint
1515
# message_type :string(255)
1616
# message :text(16777215)
1717
#
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class ChangeSubmissionToBigint < ActiveRecord::Migration[7.2]
2+
def change
3+
change_column :old_submission_testdata_results, :time, :bigint
4+
change_column :old_submission_testdata_results, :rss, :bigint
5+
change_column :old_submissions, :total_time, :bigint
6+
change_column :old_submissions, :total_memory, :bigint
7+
change_column :submission_testdata_results, :rss, :bigint
8+
change_column :submission_testdata_results, :vss, :bigint
9+
change_column :submissions, :total_time, :bigint
10+
change_column :submissions, :total_memory, :bigint
11+
end
12+
end

db/schema.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema[7.2].define(version: 2025_02_18_175247) do
13+
ActiveRecord::Schema[7.2].define(version: 2025_06_06_023828) do
1414
create_table "active_admin_comments", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
1515
t.string "namespace"
1616
t.text "body", size: :medium
@@ -195,8 +195,8 @@
195195
t.integer "position"
196196
t.string "result"
197197
t.decimal "score", precision: 18, scale: 6
198-
t.integer "time"
199-
t.integer "rss"
198+
t.bigint "time"
199+
t.bigint "rss"
200200
t.datetime "created_at", null: false
201201
t.datetime "updated_at", null: false
202202
t.index ["old_submission_id"], name: "index_old_submission_testdata_results_on_old_submission_id"
@@ -207,8 +207,8 @@
207207
t.bigint "problem_id"
208208
t.string "result"
209209
t.decimal "score", precision: 18, scale: 6
210-
t.integer "total_time"
211-
t.integer "total_memory"
210+
t.bigint "total_time"
211+
t.bigint "total_memory"
212212
t.datetime "created_at", null: false
213213
t.datetime "updated_at", null: false
214214
t.index ["problem_id", "result", "score", "total_time", "total_memory"], name: "index_old_submissions_topcoder", order: { score: :desc }
@@ -303,11 +303,11 @@
303303
t.integer "position"
304304
t.string "result"
305305
t.decimal "time", precision: 12, scale: 3
306-
t.integer "rss"
306+
t.bigint "rss"
307307
t.decimal "score", precision: 18, scale: 6
308308
t.datetime "created_at", null: false
309309
t.datetime "updated_at", null: false
310-
t.integer "vss"
310+
t.bigint "vss"
311311
t.string "message_type"
312312
t.text "message", size: :medium
313313
t.index ["submission_id", "position"], name: "index_submission_testdata_results_on_submission_id_and_position", unique: true
@@ -322,8 +322,8 @@
322322
t.bigint "problem_id", default: 0
323323
t.bigint "user_id", default: 0
324324
t.bigint "contest_id"
325-
t.integer "total_time"
326-
t.integer "total_memory"
325+
t.bigint "total_time"
326+
t.bigint "total_memory"
327327
t.text "message", size: :medium
328328
t.bigint "compiler_id", null: false
329329
t.bigint "code_length", default: 0, null: false

test/fixtures/submission_testdata_results.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
# position :integer
88
# result :string(255)
99
# time :decimal(12, 3)
10-
# rss :integer
10+
# rss :bigint
1111
# score :decimal(18, 6)
1212
# created_at :datetime not null
1313
# updated_at :datetime not null
14-
# vss :integer
14+
# vss :bigint
1515
# message_type :string(255)
1616
# message :text(16777215)
1717
#

test/fixtures/submissions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# problem_id :bigint default(0)
1111
# user_id :bigint default(0)
1212
# contest_id :bigint
13-
# total_time :integer
14-
# total_memory :integer
13+
# total_time :bigint
14+
# total_memory :bigint
1515
# message :text(16777215)
1616
# compiler_id :bigint not null
1717
# code_length :bigint default(0), not null

test/models/submission_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
# problem_id :bigint default(0)
1111
# user_id :bigint default(0)
1212
# contest_id :bigint
13-
# total_time :integer
14-
# total_memory :integer
13+
# total_time :bigint
14+
# total_memory :bigint
1515
# message :text(16777215)
1616
# compiler_id :bigint not null
1717
# code_length :bigint default(0), not null

0 commit comments

Comments
 (0)