From b66e9fc05d4d8eb49d6eb478aa19fa692d1fb20f Mon Sep 17 00:00:00 2001 From: Maximilian Grundke Date: Wed, 2 Mar 2016 14:52:39 +0100 Subject: [PATCH] Add Testrun to schema --- app/models/testrun.rb | 4 ++++ db/migrate/20160302133540_create_testruns.rb | 13 +++++++++++++ db/schema.rb | 11 ++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 app/models/testrun.rb create mode 100644 db/migrate/20160302133540_create_testruns.rb diff --git a/app/models/testrun.rb b/app/models/testrun.rb new file mode 100644 index 00000000..316acfdc --- /dev/null +++ b/app/models/testrun.rb @@ -0,0 +1,4 @@ +class Testrun < ActiveRecord::Base + belongs_to :file + belongs_to :submission +end diff --git a/db/migrate/20160302133540_create_testruns.rb b/db/migrate/20160302133540_create_testruns.rb new file mode 100644 index 00000000..7590f2a3 --- /dev/null +++ b/db/migrate/20160302133540_create_testruns.rb @@ -0,0 +1,13 @@ +class CreateTestruns < ActiveRecord::Migration + def change + create_table :testruns do |t| + t.boolean :passed + t.text :output + + t.belongs_to :file + t.belongs_to :submission + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 1ec47e98..4ba78542 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160204111716) do +ActiveRecord::Schema.define(version: 20160302133540) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -211,4 +211,13 @@ ActiveRecord::Schema.define(version: 20160204111716) do t.datetime "updated_at" end + create_table "testruns", force: true do |t| + t.boolean "passed" + t.text "output" + t.integer "file_id" + t.integer "submission_id" + t.datetime "created_at" + t.datetime "updated_at" + end + end