Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
merge with rails7 branch
Commit Description:
merge with rails7 branch
class AddNumberToSubmissions < ActiveRecord :: Migration [ 4 . 2 ]
def self . up
add_column :submissions , :number , :integer
# add number field for all records
Submission . reset_column_information
last_user_id = nil
last_problem_id = nil
current_number = 0
Submission . order ( 'user_id, problem_id, submitted_at' ) . each do | submission |
if submission . user_id == last_user_id and submission . problem_id == last_problem_id
current_number += 1
else
current_number = 1
end
submission . number = current_number
submission . save
last_user_id = submission . user_id
last_problem_id = submission . problem_id
end
add_index :submissions , [ :user_id , :problem_id , :number ] , :unique => true
end
def self . down
remove_index :submissions , :column => [ :user_id , :problem_id , :number ]
remove_column :submissions , :number
end
end
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository permissions settings