diff --git a/Gemfile b/Gemfile index 29368642..5a6898b0 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby ">= 2.4.10", "< 2.5" -gem "rails", "~> 5.0.7.2" +gem "rails", "~> 5.1.7" gem "devise", "~> 4.0" gem "psych", "~> 2.0.2" # part of stdlib, need newer version for safe_load @@ -24,7 +24,7 @@ gem "loofah", "<= 2.20.0" gem "whenever", require: false # for cron jobs gem "tilt" gem "simple-navigation", "3.11.0" -gem "simple_form", "3.3.1" +gem "simple_form", "~> 4.1.0" gem "render_anywhere" gem "pygments.rb", "~> 2.0" gem "ranked-model" diff --git a/Gemfile.lock b/Gemfile.lock index fc8a014b..c22e2bd6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,43 +17,43 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.1.1) - actioncable (5.0.7.2) - actionpack (= 5.0.7.2) - nio4r (>= 1.2, < 3.0) + actioncable (5.1.7) + actionpack (= 5.1.7) + nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.0.7.2) - actionpack (= 5.0.7.2) - actionview (= 5.0.7.2) - activejob (= 5.0.7.2) + actionmailer (5.1.7) + actionpack (= 5.1.7) + actionview (= 5.1.7) + activejob (= 5.1.7) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.0.7.2) - actionview (= 5.0.7.2) - activesupport (= 5.0.7.2) + actionpack (5.1.7) + actionview (= 5.1.7) + activesupport (= 5.1.7) rack (~> 2.0) - rack-test (~> 0.6.3) + rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.0.7.2) - activesupport (= 5.0.7.2) + actionview (5.1.7) + activesupport (= 5.1.7) builder (~> 3.1) - erubis (~> 2.7.0) + erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.0.7.2) - activesupport (= 5.0.7.2) + activejob (5.1.7) + activesupport (= 5.1.7) globalid (>= 0.3.6) - activemodel (5.0.7.2) - activesupport (= 5.0.7.2) + activemodel (5.1.7) + activesupport (= 5.1.7) activemodel-serializers-xml (1.0.3) activemodel (>= 5.0.0.a) activesupport (>= 5.0.0.a) builder (~> 3.1) - activerecord (5.0.7.2) - activemodel (= 5.0.7.2) - activesupport (= 5.0.7.2) - arel (~> 7.0) - activesupport (5.0.7.2) + activerecord (5.1.7) + activemodel (= 5.1.7) + activesupport (= 5.1.7) + arel (~> 8.0) + activesupport (5.1.7) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -63,7 +63,7 @@ GEM afm (0.2.2) airbrussh (1.5.3) sshkit (>= 1.6.1, != 1.7.0) - arel (7.1.4) + arel (8.0.0) ast (2.4.3) atomic (1.1.101) avl_tree (1.2.1) @@ -129,13 +129,12 @@ GEM railties (>= 4.1.0) responders warden (~> 1.2.3) - diff-lcs (1.6.1) + diff-lcs (1.6.2) docile (1.3.5) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) ed25519 (1.3.0) erubi (1.13.1) - erubis (2.7.0) eventmachine (1.2.7) execjs (2.9.0) factory_bot (5.2.0) @@ -181,10 +180,10 @@ GEM atomic (~> 1.0) avl_tree (~> 1.2.0) hitimes (~> 1.1) - mime-types (3.6.2) + mime-types (3.7.0) logger - mime-types-data (~> 3.2015) - mime-types-data (3.2025.0415) + mime-types-data (~> 3.2025, >= 3.2025.0507) + mime-types-data (3.2025.0701) mini_mime (1.1.2) mini_portile2 (2.4.0) mini_racer (0.4.0) @@ -193,8 +192,8 @@ GEM mustermann (2.0.2) ruby2_keywords (~> 0.0.1) net-http-digest_auth (1.4.1) - net-http-persistent (4.0.5) - connection_pool (~> 2.2) + net-http-persistent (4.0.6) + connection_pool (~> 2.2, >= 2.2.4) net-scp (4.1.0) net-ssh (>= 2.6.5, < 8.0.0) net-sftp (4.0.0) @@ -221,7 +220,7 @@ GEM ttfunk pdfkit (0.8.4.3.2) pg (1.2.3) - pkg-config (1.6.1) + pkg-config (1.6.2) prawn (2.2.2) pdf-core (~> 0.7.0) ttfunk (~> 1.5) @@ -233,22 +232,22 @@ GEM activesupport (>= 3.0.0) pygments.rb (2.3.1) racc (1.5.2) - rack (2.2.13) + rack (2.2.17) rack-protection (2.2.3) rack - rack-test (0.6.3) - rack (>= 1.0) - rails (5.0.7.2) - actioncable (= 5.0.7.2) - actionmailer (= 5.0.7.2) - actionpack (= 5.0.7.2) - actionview (= 5.0.7.2) - activejob (= 5.0.7.2) - activemodel (= 5.0.7.2) - activerecord (= 5.0.7.2) - activesupport (= 5.0.7.2) + rack-test (2.2.0) + rack (>= 1.3) + rails (5.1.7) + actioncable (= 5.1.7) + actionmailer (= 5.1.7) + actionpack (= 5.1.7) + actionview (= 5.1.7) + activejob (= 5.1.7) + activemodel (= 5.1.7) + activerecord (= 5.1.7) + activesupport (= 5.1.7) bundler (>= 1.3.0) - railties (= 5.0.7.2) + railties (= 5.1.7) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) @@ -260,9 +259,9 @@ GEM nokogiri (>= 1.6) rails-html-sanitizer (1.5.0) loofah (~> 2.19, >= 2.19.1) - railties (5.0.7.2) - actionpack (= 5.0.7.2) - activesupport (= 5.0.7.2) + railties (5.1.7) + actionpack (= 5.1.7) + activesupport (= 5.1.7) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) @@ -338,9 +337,9 @@ GEM concurrent-ruby (~> 1.0, >= 1.0.2) simple-navigation (3.11.0) activesupport (>= 2.3.2) - simple_form (3.3.1) - actionpack (> 4, < 5.1) - activemodel (> 4, < 5.1) + simple_form (4.1.0) + actionpack (>= 5.0) + activemodel (>= 5.0) simplecov (0.18.5) docile (~> 1.1) simplecov-html (~> 0.11) @@ -446,7 +445,7 @@ DEPENDENCIES pundit (~> 1.1.0) pygments.rb (~> 2.0) qless! - rails (~> 5.0.7.2) + rails (~> 5.1.7) rails-controller-testing (~> 1.0) ranked-model recaptcha @@ -462,7 +461,7 @@ DEPENDENCIES sd_notify sentry-rails simple-navigation (= 3.11.0) - simple_form (= 3.3.1) + simple_form (~> 4.1.0) simplecov sinatra spring diff --git a/db/schema.rb b/db/schema.rb index e5a82dd0..459469d1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -15,145 +15,145 @@ # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" - create_table "contest_relations", force: :cascade do |t| - t.integer "user_id" - t.integer "contest_id" + create_table "contest_relations", id: :serial, force: :cascade do |t| + t.integer "user_id" + t.integer "contest_id" t.datetime "started_at" t.datetime "created_at" t.datetime "updated_at" t.datetime "finish_at" - t.integer "score", default: 0, null: false - t.float "time_taken", default: 0.0, null: false - t.integer "school_id" - t.integer "status", default: 0 - t.integer "extra_time", default: 0 + t.integer "score", default: 0, null: false + t.float "time_taken", default: 0.0, null: false + t.integer "school_id" + t.integer "status", default: 0 + t.integer "extra_time", default: 0 t.datetime "start_time" t.datetime "end_time" - t.string "country_code", limit: 2 - t.integer "school_year" - t.integer "supervisor_id" - t.boolean "checked_in", default: false - t.index ["contest_id", "score", "time_taken"], name: "index_contest_relations_on_contest_id_and_score_and_time_taken", order: { score: :desc }, using: :btree - t.index ["contest_id", "user_id"], name: "index_contest_relations_on_contest_id_and_user_id", unique: true, using: :btree - t.index ["user_id", "started_at"], name: "index_contest_relations_on_user_id_and_started_at", using: :btree - end - - create_table "contest_scores", force: :cascade do |t| - t.integer "contest_relation_id", null: false - t.integer "problem_id", null: false - t.integer "score" - t.integer "attempts" - t.integer "attempt" - t.integer "submission_id" + t.string "country_code", limit: 2 + t.integer "school_year" + t.integer "supervisor_id" + t.boolean "checked_in", default: false + t.index ["contest_id", "score", "time_taken"], name: "index_contest_relations_on_contest_id_and_score_and_time_taken", order: { score: :desc } + t.index ["contest_id", "user_id"], name: "index_contest_relations_on_contest_id_and_user_id", unique: true + t.index ["user_id", "started_at"], name: "index_contest_relations_on_user_id_and_started_at" + end + + create_table "contest_scores", id: :serial, force: :cascade do |t| + t.integer "contest_relation_id", null: false + t.integer "problem_id", null: false + t.integer "score" + t.integer "attempts" + t.integer "attempt" + t.integer "submission_id" t.datetime "updated_at" - t.index ["contest_relation_id", "problem_id"], name: "index_contest_scores_on_contest_relation_id_and_problem_id", using: :btree + t.index ["contest_relation_id", "problem_id"], name: "index_contest_scores_on_contest_relation_id_and_problem_id" end - create_table "contest_supervisors", force: :cascade do |t| - t.integer "contest_id" - t.integer "user_id" - t.string "site_type", limit: 255 - t.integer "site_id" + create_table "contest_supervisors", id: :serial, force: :cascade do |t| + t.integer "contest_id" + t.integer "user_id" + t.string "site_type", limit: 255 + t.integer "site_id" t.datetime "created_at" t.datetime "updated_at" t.datetime "scheduled_start_time" end - create_table "contests", force: :cascade do |t| - t.string "name", limit: 255 + create_table "contests", id: :serial, force: :cascade do |t| + t.string "name", limit: 255 t.datetime "start_time" t.datetime "end_time" - t.decimal "duration" - t.integer "owner_id" + t.decimal "duration" + t.integer "owner_id" t.datetime "created_at" t.datetime "updated_at" - t.integer "problem_set_id" + t.integer "problem_set_id" t.datetime "finalized_at" - t.string "startcode", limit: 255 - t.integer "observation", default: 1 - t.integer "registration", default: 0 - t.integer "affiliation", default: 0 - t.boolean "live_scoreboard", default: true - t.boolean "only_rank_official_contestants", default: false + t.string "startcode", limit: 255 + t.integer "observation", default: 1 + t.integer "registration", default: 0 + t.integer "affiliation", default: 0 + t.boolean "live_scoreboard", default: true + t.boolean "only_rank_official_contestants", default: false end - create_table "entities", force: :cascade do |t| - t.string "name", limit: 255 + create_table "entities", id: :serial, force: :cascade do |t| + t.string "name", limit: 255 t.integer "entity_id" - t.string "entity_type", limit: 255 + t.string "entity_type", limit: 255 end - create_table "evaluators", force: :cascade do |t| - t.string "name", limit: 255, null: false - t.text "description", default: "", null: false - t.text "source", default: "", null: false - t.integer "owner_id", null: false + create_table "evaluators", id: :serial, force: :cascade do |t| + t.string "name", limit: 255, null: false + t.text "description", default: "", null: false + t.text "source", default: "", null: false + t.integer "owner_id", null: false t.datetime "created_at" t.datetime "updated_at" - t.integer "language_id" + t.integer "language_id" end - create_table "file_attachments", force: :cascade do |t| - t.string "name", limit: 255 - t.string "file_attachment", limit: 255 - t.integer "owner_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + create_table "file_attachments", id: :serial, force: :cascade do |t| + t.string "name", limit: 255 + t.string "file_attachment", limit: 255 + t.integer "owner_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "filelinks", force: :cascade do |t| - t.integer "root_id" - t.integer "file_attachment_id" + create_table "filelinks", id: :serial, force: :cascade do |t| + t.integer "root_id" + t.integer "file_attachment_id" t.datetime "created_at" - t.string "filepath", limit: 255 - t.string "root_type", limit: 255 - t.integer "visibility", limit: 2, default: 0 - t.index ["file_attachment_id"], name: "index_filelinks_on_file_attachment_id", using: :btree - t.index ["root_id", "filepath"], name: "index_filelinks_on_root_id_and_filepath", using: :btree + t.string "filepath", limit: 255 + t.string "root_type", limit: 255 + t.integer "visibility", limit: 2, default: 0 + t.index ["file_attachment_id"], name: "index_filelinks_on_file_attachment_id" + t.index ["root_id", "filepath"], name: "index_filelinks_on_root_id_and_filepath" end create_table "group_contests", force: :cascade do |t| t.integer "group_id" t.integer "contest_id" - t.index ["contest_id", "group_id"], name: "index_group_contests_on_contest_id_and_group_id", using: :btree - t.index ["group_id", "contest_id"], name: "index_group_contests_on_group_id_and_contest_id", using: :btree + t.index ["contest_id", "group_id"], name: "index_group_contests_on_contest_id_and_group_id" + t.index ["group_id", "contest_id"], name: "index_group_contests_on_group_id_and_contest_id" end create_table "group_memberships", force: :cascade do |t| - t.integer "group_id" - t.integer "member_id" + t.integer "group_id" + t.integer "member_id" t.datetime "created_at" end create_table "group_problem_sets", force: :cascade do |t| t.integer "group_id" t.integer "problem_set_id" - t.string "name", limit: 255 - t.index ["group_id", "problem_set_id"], name: "index_group_problem_sets_on_group_id_and_problem_set_id", using: :btree - t.index ["problem_set_id", "group_id"], name: "index_group_problem_sets_on_problem_set_id_and_group_id", using: :btree + t.string "name", limit: 255 + t.index ["group_id", "problem_set_id"], name: "index_group_problem_sets_on_group_id_and_problem_set_id" + t.index ["problem_set_id", "group_id"], name: "index_group_problem_sets_on_problem_set_id_and_group_id" end - create_table "groups", force: :cascade do |t| - t.string "name", limit: 255 + create_table "groups", id: :serial, force: :cascade do |t| + t.string "name", limit: 255 t.datetime "created_at" t.datetime "updated_at" - t.integer "owner_id" - t.integer "visibility", default: 0, null: false - t.integer "membership", default: 0, null: false + t.integer "owner_id" + t.integer "visibility", default: 0, null: false + t.integer "membership", default: 0, null: false end - create_table "item_histories", force: :cascade do |t| - t.integer "item_id" - t.boolean "active" - t.integer "action" - t.integer "holder_id" - t.string "data", limit: 255 + create_table "item_histories", id: :serial, force: :cascade do |t| + t.integer "item_id" + t.boolean "active" + t.integer "action" + t.integer "holder_id" + t.string "data", limit: 255 t.datetime "acted_at" t.datetime "created_at" t.datetime "updated_at" end - create_table "items", force: :cascade do |t| + create_table "items", id: :serial, force: :cascade do |t| t.integer "product_id" t.integer "owner_id" t.integer "organisation_id" @@ -165,101 +165,101 @@ t.integer "scan_token" end - create_table "language_groups", force: :cascade do |t| - t.string "identifier", limit: 255 - t.string "name", limit: 255 - t.integer "current_language_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["identifier"], name: "index_language_groups_on_identifier", unique: true, using: :btree - end - - create_table "languages", force: :cascade do |t| - t.string "identifier", limit: 255 - t.string "compiler", limit: 255 - t.boolean "interpreted" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "extension", limit: 255 - t.boolean "compiled" - t.string "name", limit: 255 - t.string "lexer", limit: 255 - t.integer "group_id" - t.string "source_filename", limit: 255 - t.string "exe_extension", limit: 255 - t.string "compiler_command", limit: 255 - t.string "interpreter", limit: 255 - t.string "interpreter_command", limit: 255 - t.integer "processes", default: 1 - t.index ["identifier"], name: "index_languages_on_identifier", unique: true, using: :btree - end - - create_table "organisations", force: :cascade do |t| - end - - create_table "problem_series", force: :cascade do |t| - t.string "name", limit: 255 - t.string "identifier", limit: 255 + create_table "language_groups", id: :serial, force: :cascade do |t| + t.string "identifier", limit: 255 + t.string "name", limit: 255 + t.integer "current_language_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["identifier"], name: "index_language_groups_on_identifier", unique: true + end + + create_table "languages", id: :serial, force: :cascade do |t| + t.string "identifier", limit: 255 + t.string "compiler", limit: 255 + t.boolean "interpreted" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "extension", limit: 255 + t.boolean "compiled" + t.string "name", limit: 255 + t.string "lexer", limit: 255 + t.integer "group_id" + t.string "source_filename", limit: 255 + t.string "exe_extension", limit: 255 + t.string "compiler_command", limit: 255 + t.string "interpreter", limit: 255 + t.string "interpreter_command", limit: 255 + t.integer "processes", default: 1 + t.index ["identifier"], name: "index_languages_on_identifier", unique: true + end + + create_table "organisations", id: :serial, force: :cascade do |t| + end + + create_table "problem_series", id: :serial, force: :cascade do |t| + t.string "name", limit: 255 + t.string "identifier", limit: 255 t.string "importer_type", limit: 255 - t.text "index_yaml" + t.text "index_yaml" end create_table "problem_set_problems", force: :cascade do |t| t.integer "problem_set_id" t.integer "problem_id" t.integer "problem_set_order" - t.integer "weighting", default: 100 - t.index ["problem_id", "problem_set_id"], name: "index_problem_set_problems_on_problem_id_and_problem_set_id", using: :btree - t.index ["problem_set_id", "problem_id"], name: "index_problem_set_problems_on_problem_set_id_and_problem_id", using: :btree + t.integer "weighting", default: 100 + t.index ["problem_id", "problem_set_id"], name: "index_problem_set_problems_on_problem_id_and_problem_set_id" + t.index ["problem_set_id", "problem_id"], name: "index_problem_set_problems_on_problem_set_id_and_problem_id" end - create_table "problem_sets", force: :cascade do |t| - t.string "name", limit: 255 - t.integer "owner_id" + create_table "problem_sets", id: :serial, force: :cascade do |t| + t.string "name", limit: 255 + t.integer "owner_id" t.datetime "created_at" t.datetime "updated_at" - t.integer "finalized_contests_count", default: 0 + t.integer "finalized_contests_count", default: 0 end - create_table "problems", force: :cascade do |t| - t.string "name", limit: 255 - t.text "statement" - t.string "input", limit: 255 - t.string "output", limit: 255 - t.integer "memory_limit" - t.decimal "time_limit" - t.integer "owner_id" + create_table "problems", id: :serial, force: :cascade do |t| + t.string "name", limit: 255 + t.text "statement" + t.string "input", limit: 255 + t.string "output", limit: 255 + t.integer "memory_limit" + t.decimal "time_limit" + t.integer "owner_id" t.datetime "created_at" t.datetime "updated_at" - t.integer "evaluator_id" + t.integer "evaluator_id" t.datetime "rejudge_at" - t.integer "test_error_count", default: 0 - t.integer "test_warning_count", default: 0 - t.integer "test_status", default: 0 + t.integer "test_error_count", default: 0 + t.integer "test_warning_count", default: 0 + t.integer "test_status", default: 0 end - create_table "products", force: :cascade do |t| - t.string "name", limit: 255 + create_table "products", id: :serial, force: :cascade do |t| + t.string "name", limit: 255 t.bigint "gtin" - t.text "description" - t.string "image", limit: 255 + t.text "description" + t.string "image", limit: 255 end - create_table "requests", force: :cascade do |t| - t.integer "requester_id" - t.integer "subject_id" - t.string "subject_type", limit: 255 - t.string "verb", limit: 255, null: false - t.integer "target_id", null: false - t.string "target_type", limit: 255, null: false - t.integer "status", default: 0, null: false - t.integer "requestee_id" - t.datetime "expired_at", default: 'Infinity', null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + create_table "requests", id: :serial, force: :cascade do |t| + t.integer "requester_id" + t.integer "subject_id" + t.string "subject_type", limit: 255 + t.string "verb", limit: 255, null: false + t.integer "target_id", null: false + t.string "target_type", limit: 255, null: false + t.integer "status", default: 0, null: false + t.integer "requestee_id" + t.datetime "expired_at", default: "Infinity", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "roles", force: :cascade do |t| + create_table "roles", id: :serial, force: :cascade do |t| t.string "name", limit: 255 end @@ -268,129 +268,129 @@ t.integer "user_id" end - create_table "schools", force: :cascade do |t| - t.string "name", limit: 255 - t.string "country_code", limit: 2 + create_table "schools", id: :serial, force: :cascade do |t| + t.string "name", limit: 255 + t.string "country_code", limit: 2 t.integer "users_count" t.integer "synonym_id" end - create_table "sessions", force: :cascade do |t| - t.string "session_id", limit: 255, null: false - t.text "data" + create_table "sessions", id: :serial, force: :cascade do |t| + t.string "session_id", limit: 255, null: false + t.text "data" t.datetime "created_at" t.datetime "updated_at" - t.index ["created_at"], name: "index_sessions_on_created_at", using: :btree - t.index ["session_id"], name: "index_sessions_on_session_id", using: :btree - t.index ["updated_at"], name: "index_sessions_on_updated_at", using: :btree + t.index ["created_at"], name: "index_sessions_on_created_at" + t.index ["session_id"], name: "index_sessions_on_session_id" + t.index ["updated_at"], name: "index_sessions_on_updated_at" end - create_table "settings", force: :cascade do |t| - t.string "key", limit: 255 + create_table "settings", id: :serial, force: :cascade do |t| + t.string "key", limit: 255 t.string "value", limit: 255 - t.index ["key"], name: "index_settings_on_key", unique: true, using: :btree + t.index ["key"], name: "index_settings_on_key", unique: true end - create_table "submissions", force: :cascade do |t| - t.text "source" - t.integer "score" - t.integer "user_id" - t.integer "problem_id" + create_table "submissions", id: :serial, force: :cascade do |t| + t.text "source" + t.integer "score" + t.integer "user_id" + t.integer "problem_id" t.datetime "created_at" t.datetime "updated_at" - t.string "input", limit: 255 - t.string "output", limit: 255 - t.integer "language_id" - t.text "judge_log" + t.string "input", limit: 255 + t.string "output", limit: 255 + t.integer "language_id" + t.text "judge_log" t.datetime "judged_at" - t.string "job", limit: 255 - t.integer "classification" - t.string "test_errors", limit: 255, array: true - t.string "test_warnings", limit: 255, array: true - t.float "evaluation" - t.decimal "points" - t.integer "maximum_points" - t.index ["problem_id", "created_at"], name: "index_submissions_on_problem_id_and_created_at", using: :btree - t.index ["user_id", "problem_id"], name: "index_submissions_on_user_id_and_problem_id", using: :btree - end - - create_table "test_case_relations", force: :cascade do |t| - t.integer "test_case_id" - t.integer "test_set_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["test_case_id"], name: "index_test_case_relations_on_test_case_id", using: :btree - t.index ["test_set_id"], name: "index_test_case_relations_on_test_set_id", using: :btree - end - - create_table "test_cases", force: :cascade do |t| - t.text "input" - t.text "output" - t.string "name", limit: 255 + t.string "job", limit: 255 + t.integer "classification" + t.string "test_errors", limit: 255, array: true + t.string "test_warnings", limit: 255, array: true + t.float "evaluation" + t.decimal "points" + t.integer "maximum_points" + t.index ["problem_id", "created_at"], name: "index_submissions_on_problem_id_and_created_at" + t.index ["user_id", "problem_id"], name: "index_submissions_on_user_id_and_problem_id" + end + + create_table "test_case_relations", id: :serial, force: :cascade do |t| + t.integer "test_case_id" + t.integer "test_set_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["test_case_id"], name: "index_test_case_relations_on_test_case_id" + t.index ["test_set_id"], name: "index_test_case_relations_on_test_set_id" + end + + create_table "test_cases", id: :serial, force: :cascade do |t| + t.text "input" + t.text "output" + t.string "name", limit: 255 t.datetime "created_at" t.datetime "updated_at" - t.integer "problem_id" - t.boolean "sample", default: false - t.integer "problem_order" - t.index ["problem_id", "name"], name: "index_test_cases_on_problem_id_and_name", unique: true, using: :btree + t.integer "problem_id" + t.boolean "sample", default: false + t.integer "problem_order" + t.index ["problem_id", "name"], name: "index_test_cases_on_problem_id_and_name", unique: true end - create_table "test_sets", force: :cascade do |t| - t.integer "problem_id" - t.integer "points" - t.string "name", limit: 255 + create_table "test_sets", id: :serial, force: :cascade do |t| + t.integer "problem_id" + t.integer "points" + t.string "name", limit: 255 t.datetime "created_at" t.datetime "updated_at" - t.boolean "prerequisite", default: false - t.integer "problem_order" - t.index ["problem_id", "name"], name: "index_test_sets_on_problem_id_and_name", unique: true, using: :btree - end - - create_table "user_problem_relations", force: :cascade do |t| - t.integer "problem_id" - t.integer "user_id" - t.integer "submissions_count" - t.integer "ranked_score" - t.integer "ranked_submission_id" - t.integer "submission_id" + t.boolean "prerequisite", default: false + t.integer "problem_order" + t.index ["problem_id", "name"], name: "index_test_sets_on_problem_id_and_name", unique: true + end + + create_table "user_problem_relations", id: :serial, force: :cascade do |t| + t.integer "problem_id" + t.integer "user_id" + t.integer "submissions_count" + t.integer "ranked_score" + t.integer "ranked_submission_id" + t.integer "submission_id" t.datetime "last_viewed_at" t.datetime "first_viewed_at" t.datetime "created_at" t.datetime "updated_at" - t.index ["problem_id", "ranked_score"], name: "index_user_problem_relations_on_problem_id_and_ranked_score", using: :btree - t.index ["user_id", "problem_id"], name: "index_user_problem_relations_on_user_id_and_problem_id", unique: true, using: :btree + t.index ["problem_id", "ranked_score"], name: "index_user_problem_relations_on_problem_id_and_ranked_score" + t.index ["user_id", "problem_id"], name: "index_user_problem_relations_on_user_id_and_problem_id", unique: true end - create_table "users", force: :cascade do |t| - t.string "email", limit: 255, default: "", null: false - t.string "encrypted_password", limit: 255, default: "", null: false - t.string "reset_password_token", limit: 255 + create_table "users", id: :serial, force: :cascade do |t| + t.string "email", limit: 255, default: "", null: false + t.string "encrypted_password", limit: 255, default: "", null: false + t.string "reset_password_token", limit: 255 t.datetime "reset_password_sent_at" t.datetime "remember_created_at" - t.integer "sign_in_count", default: 0 + t.integer "sign_in_count", default: 0 t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" - t.string "current_sign_in_ip", limit: 255 - t.string "last_sign_in_ip", limit: 255 + t.string "current_sign_in_ip", limit: 255 + t.string "last_sign_in_ip", limit: 255 t.datetime "created_at" t.datetime "updated_at" - t.integer "brownie_points", default: 0 - t.string "name", limit: 255 - t.string "username", limit: 255, null: false - t.boolean "can_change_username", default: false, null: false - t.string "avatar", limit: 255 - t.string "confirmation_token", limit: 255 + t.integer "brownie_points", default: 0 + t.string "name", limit: 255 + t.string "username", limit: 255, null: false + t.boolean "can_change_username", default: false, null: false + t.string "avatar", limit: 255 + t.string "confirmation_token", limit: 255 t.datetime "confirmed_at" t.datetime "confirmation_sent_at" - t.string "unconfirmed_email", limit: 255 + t.string "unconfirmed_email", limit: 255 t.datetime "last_seen_at" - t.integer "school_id" - t.string "country_code", limit: 3 - t.date "school_graduation" - t.index "lower((username)::text)", name: "index_users_on_username", unique: true, using: :btree - t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree - t.index ["email"], name: "index_users_on_email", unique: true, using: :btree - t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree + t.integer "school_id" + t.string "country_code", limit: 3 + t.date "school_graduation" + t.index "lower((username)::text)", name: "index_users_on_username", unique: true + t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true + t.index ["email"], name: "index_users_on_email", unique: true + t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true end end