Apply automatic rubocop fixes
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :exercises do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :execution_environments do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateSubmissions < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :submissions do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddReferenceImplementationToExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :exercises, :reference_implementation, :text
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddIndentSizeToExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :execution_environments, :indent_size, :integer
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateConsumers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :consumers do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :users do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddOauthKeyToConsumers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :consumers, :oauth_key, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddOauthSecretToConsumers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :consumers, :oauth_secret, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddRoleToUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :users, :role, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddUserIdToExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_reference :exercises, :user
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddRunCommandToExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :execution_environments, :run_command, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddTestCommandToExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :execution_environments, :test_command, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddTestCodeToExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :exercises, :test_code, :text
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddCauseToSubmissions < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :submissions, :cause, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddTemplateTestCodeToExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :exercises, :template_test_code, :text
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddSupportsUserDefinedTestsToExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :exercises, :supports_user_defined_tests, :boolean
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddTestingFrameworkToExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :execution_environments, :testing_framework, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateFileTypes < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :file_types do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateFiles < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :files do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RemoveFileTypeRelatedColumnsFromExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
remove_column :execution_environments, :editor_mode, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RemoveFileRelatedColumnsFromExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
remove_column :exercises, :reference_implementation, :text
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RemoveCodeFromSubmissions < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
remove_column :submissions, :code, :text
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddInstructionsToExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :exercises, :instructions, :text
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddPublishedToExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :exercises, :published, :boolean
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddExecutableToFileTypes < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :file_types, :executable, :boolean
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddRenderableToFileTypes < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :file_types, :renderable, :boolean
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateExternalUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :external_users do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateInternalUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :internal_users do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class DropUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
drop_table :users
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddUserTypeToExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :exercises, :user_type, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddUserTypeToFileTypes < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :file_types, :user_type, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddUserTypeToSubmissions < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :submissions, :user_type, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SorceryCore < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
InternalUser.delete_all
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SorceryBruteForceProtection < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :internal_users, :failed_logins_count, :integer, default: 0
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SorceryRememberMe < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :internal_users, :remember_me_token, :string, default: nil
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SorceryResetPassword < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :internal_users, :reset_password_token, :string, default: nil
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SorceryUserActivation < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :internal_users, :activation_state, :string, default: nil
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddBinaryToFileTypes < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :file_types, :binary, :boolean
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddNativeFileToFiles < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :files, :native_file, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateHints < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :hints do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RemoveNotNullConstraintsFromInternalUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
change_column_null(:internal_users, :crypted_password, true)
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateErrors < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :errors do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddTokenToExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :exercises, :token, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddFileIdToExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_reference :exercises, :file
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddRoleToFiles < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :files, :role, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RemoveFileIdFromExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
remove_reference :exercises, :file
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddHashedContentToFiles < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :files, :hashed_content, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddFeedbackMessageToFiles < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :files, :feedback_message, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddWeightToFiles < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :files, :weight, :float
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddHelpToExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :execution_environments, :help, :text
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddExposedPortsToExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :execution_environments, :exposed_ports, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddPermittedExecutionTimeToExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :execution_environments, :permitted_execution_time, :integer
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddUserIdAndUserTypeToExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_reference :execution_environments, :user
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RenamePublishedToPublic < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
rename_column :exercises, :published, :public
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddPathToFiles < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :files, :path, :string
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateComments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :comments do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateTeams < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :teams do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateInternalUsersTeams < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :internal_users_teams do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddTeamIdToExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_reference :exercises, :team
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddPoolSizeToExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :execution_environments, :pool_size, :integer
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddFileTypeIdToExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_reference :execution_environments, :file_type
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddMemoryLimitToExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :execution_environments, :memory_limit, :integer
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddNetworkEnabledToExecutionEnvironments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :execution_environments, :network_enabled, :boolean
|
||||
|
@ -1,9 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateRequestForComments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :request_for_comments do |t|
|
||||
t.integer :requestorid, :null => false
|
||||
t.integer :exerciseid, :null => false
|
||||
t.integer :fileid, :null => false
|
||||
t.integer :requestorid, null: false
|
||||
t.integer :exerciseid, null: false
|
||||
t.integer :fileid, null: false
|
||||
t.timestamp :requested_at
|
||||
|
||||
t.timestamps
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddSubmissionToError < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_reference :errors, :submission, index: true
|
||||
|
@ -1,5 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddFileIndexToFiles < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_index(:files, [:context_id, :context_type])
|
||||
add_index(:files, %i[context_id context_type])
|
||||
end
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddUserTypeToRequestForComments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :request_for_comments, :user_type, :string
|
||||
|
@ -1,7 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CorrectColumnNames < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
rename_column :request_for_comments, :requestorid, :requestor_user_id
|
||||
rename_column :request_for_comments, :exerciseid, :exercise_id
|
||||
rename_column :request_for_comments, :fileid, :file_id
|
||||
rename_column :request_for_comments, :requestorid, :requestor_user_id
|
||||
rename_column :request_for_comments, :exerciseid, :exercise_id
|
||||
rename_column :request_for_comments, :fileid, :file_id
|
||||
end
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RemoveRequestorFromRequestForComments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
rename_column :request_for_comments, :requestor_user_id, :user_id
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddHideFileTreeToExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :exercises, :hide_file_tree, :boolean
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateCodeHarborLinks < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :code_harbor_links do |t|
|
||||
|
@ -1,5 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddUserToCodeHarborLink < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_reference :code_harbor_links, :user, polymorphic: true, index: true
|
||||
add_reference :code_harbor_links, :user, polymorphic: true, index: true
|
||||
end
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateTestruns < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :testruns do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddQuestionToRequestForComments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :request_for_comments, :question, :text
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddAllowFileCreationToExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :exercises, :allow_file_creation, :boolean
|
||||
|
@ -1,7 +1,10 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ChangeCommentTextAttributeToTextDatatype < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
change_column :comments, :text, :text
|
||||
end
|
||||
|
||||
def down
|
||||
# This might cause trouble if you have strings longer
|
||||
# than 255 characters.
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateFileTemplates < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :file_templates do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddFileTemplateToFile < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_reference :files, :file_template
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddSolvedToRequestForComments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :request_for_comments, :solved, :boolean
|
||||
|
@ -1,33 +1,33 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddSubmissionToRequestForComments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_reference :request_for_comments, :submission
|
||||
end
|
||||
end
|
||||
|
||||
=begin
|
||||
We issued the following on the database to add the submission_ids for existing entries
|
||||
|
||||
UPDATE request_for_comments
|
||||
SET submission_id = sub.submission_id_external
|
||||
FROM
|
||||
(SELECT s.id AS submission_id_external,
|
||||
rfc.id AS rfc_id,
|
||||
s.created_at AS submission_created_at,
|
||||
rfc.created_at AS rfc_created_at
|
||||
FROM submissions s,
|
||||
request_for_comments rfc
|
||||
WHERE s.user_id = rfc.user_id
|
||||
AND s.exercise_id = rfc.exercise_id
|
||||
AND rfc.created_at + interval '2 hours' > s.created_at
|
||||
AND s.created_at =
|
||||
(SELECT MAX(created_at)
|
||||
FROM submissions
|
||||
WHERE exercise_id = s.exercise_id
|
||||
AND user_id = s.user_id
|
||||
AND rfc.created_at + interval '2 hours' > created_at
|
||||
GROUP BY s.exercise_id,
|
||||
s.user_id)) as sub
|
||||
WHERE id = sub.rfc_id
|
||||
AND submission_id IS NULL;
|
||||
|
||||
=end
|
||||
# We issued the following on the database to add the submission_ids for existing entries
|
||||
#
|
||||
# UPDATE request_for_comments
|
||||
# SET submission_id = sub.submission_id_external
|
||||
# FROM
|
||||
# (SELECT s.id AS submission_id_external,
|
||||
# rfc.id AS rfc_id,
|
||||
# s.created_at AS submission_created_at,
|
||||
# rfc.created_at AS rfc_created_at
|
||||
# FROM submissions s,
|
||||
# request_for_comments rfc
|
||||
# WHERE s.user_id = rfc.user_id
|
||||
# AND s.exercise_id = rfc.exercise_id
|
||||
# AND rfc.created_at + interval '2 hours' > s.created_at
|
||||
# AND s.created_at =
|
||||
# (SELECT MAX(created_at)
|
||||
# FROM submissions
|
||||
# WHERE exercise_id = s.exercise_id
|
||||
# AND user_id = s.user_id
|
||||
# AND rfc.created_at + interval '2 hours' > created_at
|
||||
# GROUP BY s.exercise_id,
|
||||
# s.user_id)) as sub
|
||||
# WHERE id = sub.rfc_id
|
||||
# AND submission_id IS NULL;
|
||||
#
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RemoveRequestedAtFromRequestForComments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
remove_column :request_for_comments, :requested_at
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RemoveTeams < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
remove_reference :exercises, :team
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddAllowAutoCompletionToExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :exercises, :allow_auto_completion, :boolean, default: false
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateLtiParameters < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :lti_parameters do |t|
|
||||
@ -8,4 +10,4 @@ class CreateLtiParameters < ActiveRecord::Migration[4.2]
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,11 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateRemoteEvaluationMappings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :remote_evaluation_mappings do |t|
|
||||
t.integer "user_id", null: false
|
||||
t.integer "exercise_id", null: false
|
||||
t.string "validation_token", null: false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer 'user_id', null: false
|
||||
t.integer 'exercise_id', null: false
|
||||
t.string 'validation_token', null: false
|
||||
t.datetime 'created_at'
|
||||
t.datetime 'updated_at'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateExerciseCollections < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :exercise_collections do |t|
|
||||
@ -9,6 +11,5 @@ class CreateExerciseCollections < ActiveRecord::Migration[4.2]
|
||||
t.belongs_to :exercise_collection, index: true
|
||||
t.belongs_to :exercise, index: true
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateProxyExercises < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :proxy_exercises do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateInterventions < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :user_exercise_interventions do |t|
|
||||
@ -16,8 +18,5 @@ class CreateInterventions < ActiveRecord::Migration[4.2]
|
||||
end
|
||||
|
||||
Intervention.createDefaultInterventions
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
@ -1,5 +1,6 @@
|
||||
class AddTags < ActiveRecord::Migration[4.2]
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddTags < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :exercises, :expected_worktime_seconds, :integer, default: 60
|
||||
add_column :exercises, :expected_difficulty, :integer, default: 1
|
||||
@ -15,5 +16,4 @@ class AddTags < ActiveRecord::Migration[4.2]
|
||||
t.integer :factor, default: 1
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddUserFeedback < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :user_exercise_feedbacks do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddSearch < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :searches do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddReasonToUserProxyExerciseExercise < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
change_table :user_proxy_exercise_exercises do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddIndexToSubmissions < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_index :submissions, :exercise_id
|
||||
|
@ -1,6 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SetDefaultForRequestForCommentSolved < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
change_column_default :request_for_comments, :solved, false
|
||||
RequestForComment.where(solved: nil).update_all(solved: false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ImproveUserFeedback < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :user_exercise_feedbacks, :user_estimated_worktime, :integer
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddThankYouNoteToRequestForComments < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :request_for_comments, :thank_you_note, :text
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateErrorTemplates < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :error_templates do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateErrorTemplateAttributes < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :error_template_attributes do |t|
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateStructuredErrors < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :structured_errors do |t|
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user