diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20160101024323_extend_result.rb | 6 | ||||
-rw-r--r-- | db/migrate/20160101060555_add_command_line_to_compilers.rb | 5 | ||||
-rw-r--r-- | db/migrate/20160101121151_add_language_to_snippet.rb | 5 | ||||
-rw-r--r-- | db/schema.rb | 14 | ||||
-rw-r--r-- | db/seeds.rb | 5 |
5 files changed, 25 insertions, 10 deletions
diff --git a/db/migrate/20160101024323_extend_result.rb b/db/migrate/20160101024323_extend_result.rb new file mode 100644 index 0000000..7c04f69 --- /dev/null +++ b/db/migrate/20160101024323_extend_result.rb @@ -0,0 +1,6 @@ +class ExtendResult < ActiveRecord::Migration[5.0] + def change + add_column :results, :result, :integer, null: false + add_column :results, :status, :integer, null: false + end +end diff --git a/db/migrate/20160101060555_add_command_line_to_compilers.rb b/db/migrate/20160101060555_add_command_line_to_compilers.rb new file mode 100644 index 0000000..215855d --- /dev/null +++ b/db/migrate/20160101060555_add_command_line_to_compilers.rb @@ -0,0 +1,5 @@ +class AddCommandLineToCompilers < ActiveRecord::Migration[5.0] + def change + add_column :compilers, :command_line, :string, null: false + end +end diff --git a/db/migrate/20160101121151_add_language_to_snippet.rb b/db/migrate/20160101121151_add_language_to_snippet.rb new file mode 100644 index 0000000..d3fe545 --- /dev/null +++ b/db/migrate/20160101121151_add_language_to_snippet.rb @@ -0,0 +1,5 @@ +class AddLanguageToSnippet < ActiveRecord::Migration[5.0] + def change + add_column :snippets, :language, :string, null: false + end +end diff --git a/db/schema.rb b/db/schema.rb index 5812893..f60b7ab 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,13 +11,14 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20151226120716) do +ActiveRecord::Schema.define(version: 20160101121151) do create_table "compilers", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.string "language", limit: 64, null: false - t.string "version", limit: 64, null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.string "language", limit: 64, null: false + t.string "version", limit: 64, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "command_line", null: false t.index ["language", "version"], name: "index_compilers_on_language_and_version", unique: true, using: :btree end @@ -26,6 +27,8 @@ ActiveRecord::Schema.define(version: 20151226120716) do t.integer "compiler_id", null: false t.binary "output", limit: 65535, null: false t.datetime "created_at", null: false + t.integer "result", null: false + t.integer "status", null: false t.index ["compiler_id"], name: "index_results_on_compiler_id", using: :btree t.index ["snippet_id", "compiler_id"], name: "index_results_on_snippet_id_and_compiler_id", unique: true, using: :btree t.index ["snippet_id"], name: "index_results_on_snippet_id", using: :btree @@ -35,6 +38,7 @@ ActiveRecord::Schema.define(version: 20151226120716) do t.string "title" t.binary "code", limit: 65535, null: false t.datetime "created_at", null: false + t.string "language", null: false end add_foreign_key "results", "compilers" diff --git a/db/seeds.rb b/db/seeds.rb index f16f4fa..cfadd24 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -5,8 +5,3 @@ # # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) # Character.create(name: 'Luke', movie: movies.first) - -if Rails.env.development? - # just eval - Compiler.create(language: "ruby", version: "!!unsafe!!") -end |