Upgrade to Rails 7.0 and apply new framework defaults
* Remove `send_stream` method pulled in before upgrading Rails * Remove spring, it is no longer included by default for new apps * Remove deprecated options from environments * Remove old asset paths and workarounds no longer needed * Remove unnecessary `OAUTH_10_SUPPORT` const, LTI still uses OAuth 1.0 * Dump schema with new defaults (and specify precision for timestamps where needed)
This commit is contained in:
![49699333+dependabot[bot]@users.noreply.github.com](/assets/img/avatar_default.png)
committed by
Sebastian Serth

parent
ffe96d9223
commit
90b30e2bf7
@ -0,0 +1,10 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# This migration comes from active_storage (originally 20211119233751)
|
||||
class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
return unless table_exists?(:active_storage_blobs)
|
||||
|
||||
change_column_null(:active_storage_blobs, :checksum, true)
|
||||
end
|
||||
end
|
57
db/migrate/20221204120508_add_precision_to_timestamps.rb
Normal file
57
db/migrate/20221204120508_add_precision_to_timestamps.rb
Normal file
@ -0,0 +1,57 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddPrecisionToTimestamps < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
tables = %w[
|
||||
anomaly_notifications
|
||||
codeharbor_links
|
||||
comments
|
||||
consumers
|
||||
error_template_attributes
|
||||
error_templates
|
||||
events
|
||||
execution_environments
|
||||
exercise_collections
|
||||
exercises
|
||||
exercises_proxy_exercises
|
||||
external_users
|
||||
file_templates
|
||||
file_types
|
||||
files
|
||||
internal_users
|
||||
interventions
|
||||
linter_check_runs
|
||||
lti_parameters
|
||||
proxy_exercises
|
||||
remote_evaluation_mappings
|
||||
request_for_comments
|
||||
searches
|
||||
structured_error_attributes
|
||||
structured_errors
|
||||
study_groups
|
||||
submissions
|
||||
subscriptions
|
||||
tags
|
||||
testruns
|
||||
tips
|
||||
user_exercise_feedbacks
|
||||
user_exercise_interventions
|
||||
user_proxy_exercise_exercises
|
||||
]
|
||||
|
||||
tables.each do |table|
|
||||
change_column table, :created_at, :datetime, precision: 6
|
||||
change_column table, :updated_at, :datetime, precision: 6
|
||||
end
|
||||
|
||||
change_column :authentication_tokens, :expire_at, :datetime, precision: 6
|
||||
change_column :community_solution_locks, :locked_until, :datetime, precision: 6
|
||||
change_column :exercises, :submission_deadline, :datetime, precision: 6
|
||||
change_column :exercises, :late_submission_deadline, :datetime, precision: 6
|
||||
change_column :internal_users, :lock_expires_at, :datetime, precision: 6
|
||||
change_column :internal_users, :remember_me_token_expires_at, :datetime, precision: 6
|
||||
change_column :internal_users, :reset_password_token_expires_at, :datetime, precision: 6
|
||||
change_column :internal_users, :reset_password_email_sent_at, :datetime, precision: 6
|
||||
change_column :internal_users, :activation_token_expires_at, :datetime, precision: 6
|
||||
end
|
||||
end
|
39
db/schema.rb
39
db/schema.rb
@ -10,8 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2022_09_23_214003) do
|
||||
|
||||
ActiveRecord::Schema[7.0].define(version: 2022_12_04_120508) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_trgm"
|
||||
enable_extension "pgcrypto"
|
||||
@ -35,8 +34,8 @@ ActiveRecord::Schema.define(version: 2022_09_23_214003) do
|
||||
t.string "user_type", null: false
|
||||
t.bigint "user_id", null: false
|
||||
t.datetime "expire_at", null: false
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.bigint "study_group_id"
|
||||
t.index ["shared_secret"], name: "index_authentication_tokens_on_shared_secret", unique: true
|
||||
t.index ["study_group_id"], name: "index_authentication_tokens_on_study_group_id"
|
||||
@ -77,8 +76,8 @@ ActiveRecord::Schema.define(version: 2022_09_23_214003) do
|
||||
t.boolean "timely_contribution", null: false
|
||||
t.boolean "autosave", null: false
|
||||
t.interval "working_time", null: false
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["community_solution_id", "timely_contribution", "autosave", "proposed_changes"], name: "index_community_solution_valid_contributions"
|
||||
t.index ["community_solution_lock_id"], name: "index_community_solution_contributions_lock"
|
||||
t.index ["user_type", "user_id"], name: "index_community_solution_contributions_on_user"
|
||||
@ -89,16 +88,16 @@ ActiveRecord::Schema.define(version: 2022_09_23_214003) do
|
||||
t.string "user_type", null: false
|
||||
t.bigint "user_id", null: false
|
||||
t.datetime "locked_until"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["community_solution_id", "locked_until"], name: "index_community_solution_locks_until", unique: true
|
||||
t.index ["user_type", "user_id"], name: "index_community_solution_locks_on_user"
|
||||
end
|
||||
|
||||
create_table "community_solutions", force: :cascade do |t|
|
||||
t.bigint "exercise_id", null: false
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["exercise_id"], name: "index_community_solutions_on_exercise_id"
|
||||
end
|
||||
|
||||
@ -241,7 +240,7 @@ ActiveRecord::Schema.define(version: 2022_09_23_214003) do
|
||||
t.string "name"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.boolean "platform_admin", default: false
|
||||
t.boolean "platform_admin", default: false, null: false
|
||||
end
|
||||
|
||||
create_table "file_templates", id: :serial, force: :cascade do |t|
|
||||
@ -306,7 +305,7 @@ ActiveRecord::Schema.define(version: 2022_09_23_214003) do
|
||||
t.string "activation_state"
|
||||
t.string "activation_token"
|
||||
t.datetime "activation_token_expires_at"
|
||||
t.boolean "platform_admin", default: false
|
||||
t.boolean "platform_admin", default: false, null: false
|
||||
t.index ["activation_token"], name: "index_internal_users_on_activation_token"
|
||||
t.index ["email"], name: "index_internal_users_on_email", unique: true
|
||||
t.index ["remember_me_token"], name: "index_internal_users_on_remember_me_token"
|
||||
@ -396,8 +395,8 @@ ActiveRecord::Schema.define(version: 2022_09_23_214003) do
|
||||
t.bigint "execution_environment_id"
|
||||
t.string "user_type"
|
||||
t.bigint "user_id"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["execution_environment_id"], name: "index_runners_on_execution_environment_id"
|
||||
t.index ["user_type", "user_id"], name: "index_runners_on_user"
|
||||
end
|
||||
@ -482,8 +481,8 @@ ActiveRecord::Schema.define(version: 2022_09_23_214003) do
|
||||
create_table "testrun_execution_environments", force: :cascade do |t|
|
||||
t.bigint "testrun_id", null: false
|
||||
t.bigint "execution_environment_id", null: false
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["execution_environment_id"], name: "index_testrun_execution_environments"
|
||||
t.index ["testrun_id"], name: "index_testrun_execution_environments_on_testrun_id"
|
||||
end
|
||||
@ -495,10 +494,10 @@ ActiveRecord::Schema.define(version: 2022_09_23_214003) do
|
||||
t.integer "stream", limit: 2, comment: "Used as enum in Rails"
|
||||
t.text "log"
|
||||
t.jsonb "data"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["testrun_id"], name: "index_testrun_messages_on_testrun_id"
|
||||
t.check_constraint "(log IS NULL) OR (data IS NULL)", name: "either_data_or_log"
|
||||
t.check_constraint "log IS NULL OR data IS NULL", name: "either_data_or_log"
|
||||
end
|
||||
|
||||
create_table "testruns", id: :serial, force: :cascade do |t|
|
||||
@ -514,7 +513,7 @@ ActiveRecord::Schema.define(version: 2022_09_23_214003) do
|
||||
t.integer "exit_code", limit: 2, comment: "No exit code is available in case of a timeout"
|
||||
t.integer "status", limit: 2, default: 0, null: false, comment: "Used as enum in Rails"
|
||||
t.index ["submission_id"], name: "index_testruns_on_submission_id"
|
||||
t.check_constraint "(exit_code >= 0) AND (exit_code <= 255)", name: "exit_code_constraint"
|
||||
t.check_constraint "exit_code >= 0 AND exit_code <= 255", name: "exit_code_constraint"
|
||||
end
|
||||
|
||||
create_table "tips", force: :cascade do |t|
|
||||
|
Reference in New Issue
Block a user