Save submission alongside structured error

This commit is contained in:
Maximilian Grundke
2018-01-30 11:28:29 +01:00
parent 7768d34275
commit 40fe5c4e69
5 changed files with 24 additions and 14 deletions

View File

@ -0,0 +1,5 @@
class AddSubmissionToStructuredErrors < ActiveRecord::Migration
def change
add_reference :structured_errors, :submission, index: true
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20171120153705) do
ActiveRecord::Schema.define(version: 20180130101645) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -305,8 +305,11 @@ ActiveRecord::Schema.define(version: 20171120153705) do
t.integer "file_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "submission_id"
end
add_index "structured_errors", ["submission_id"], name: "index_structured_errors_on_submission_id", using: :btree
create_table "submissions", force: :cascade do |t|
t.integer "exercise_id"
t.float "score"