transferred Code Ocean from original repository to GitHub
This commit is contained in:
11
db/migrate/20140625134118_create_exercises.rb
Normal file
11
db/migrate/20140625134118_create_exercises.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateExercises < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :exercises do |t|
|
||||
t.text :description
|
||||
t.belongs_to :execution_environment
|
||||
t.text :template_code
|
||||
t.string :title
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
11
db/migrate/20140626143132_create_execution_environments.rb
Normal file
11
db/migrate/20140626143132_create_execution_environments.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateExecutionEnvironments < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :execution_environments do |t|
|
||||
t.string :docker_image
|
||||
t.string :editor_mode
|
||||
t.string :file_extension
|
||||
t.string :name
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
11
db/migrate/20140626144036_create_submissions.rb
Normal file
11
db/migrate/20140626144036_create_submissions.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateSubmissions < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :submissions do |t|
|
||||
t.text :code
|
||||
t.belongs_to :exercise
|
||||
t.float :score
|
||||
t.belongs_to :user
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddReferenceImplementationToExercises < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :exercises, :reference_implementation, :text
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddIndentSizeToExecutionEnvironments < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :execution_environments, :indent_size, :integer
|
||||
end
|
||||
end
|
8
db/migrate/20140701120126_create_consumers.rb
Normal file
8
db/migrate/20140701120126_create_consumers.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class CreateConsumers < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :consumers do |t|
|
||||
t.string :name
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
11
db/migrate/20140701122345_create_users.rb
Normal file
11
db/migrate/20140701122345_create_users.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateUsers < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :users do |t|
|
||||
t.belongs_to :consumer
|
||||
t.string :email
|
||||
t.string :external_id
|
||||
t.string :name
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
5
db/migrate/20140702100130_add_oauth_key_to_consumers.rb
Normal file
5
db/migrate/20140702100130_add_oauth_key_to_consumers.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddOauthKeyToConsumers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :consumers, :oauth_key, :string
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddOauthSecretToConsumers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :consumers, :oauth_secret, :string
|
||||
end
|
||||
end
|
5
db/migrate/20140716153147_add_role_to_users.rb
Normal file
5
db/migrate/20140716153147_add_role_to_users.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddRoleToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :role, :string
|
||||
end
|
||||
end
|
5
db/migrate/20140717074902_add_user_id_to_exercises.rb
Normal file
5
db/migrate/20140717074902_add_user_id_to_exercises.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddUserIdToExercises < ActiveRecord::Migration
|
||||
def change
|
||||
add_reference :exercises, :user
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddRunCommandToExecutionEnvironments < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :execution_environments, :run_command, :string
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddTestCommandToExecutionEnvironments < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :execution_environments, :test_command, :string
|
||||
end
|
||||
end
|
5
db/migrate/20140723135747_add_test_code_to_exercises.rb
Normal file
5
db/migrate/20140723135747_add_test_code_to_exercises.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddTestCodeToExercises < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :exercises, :test_code, :text
|
||||
end
|
||||
end
|
5
db/migrate/20140724155359_add_cause_to_submissions.rb
Normal file
5
db/migrate/20140724155359_add_cause_to_submissions.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddCauseToSubmissions < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :submissions, :cause, :string
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddTemplateTestCodeToExercises < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :exercises, :template_test_code, :text
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddSupportsUserDefinedTestsToExercises < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :exercises, :supports_user_defined_tests, :boolean
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddTestingFrameworkToExecutionEnvironments < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :execution_environments, :testing_framework, :string
|
||||
end
|
||||
end
|
12
db/migrate/20140812102114_create_file_types.rb
Normal file
12
db/migrate/20140812102114_create_file_types.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateFileTypes < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :file_types do |t|
|
||||
t.string :editor_mode
|
||||
t.string :file_extension
|
||||
t.integer :indent_size
|
||||
t.string :name
|
||||
t.belongs_to :user
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
14
db/migrate/20140812144733_create_files.rb
Normal file
14
db/migrate/20140812144733_create_files.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateFiles < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :files do |t|
|
||||
t.text :content
|
||||
t.belongs_to :context, polymorphic: true
|
||||
t.belongs_to :file
|
||||
t.belongs_to :file_type
|
||||
t.boolean :hidden
|
||||
t.string :name
|
||||
t.boolean :read_only
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@@ -0,0 +1,7 @@
|
||||
class RemoveFileTypeRelatedColumnsFromExecutionEnvironments < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :execution_environments, :editor_mode, :string
|
||||
remove_column :execution_environments, :file_extension, :string
|
||||
remove_column :execution_environments, :indent_size, :integer
|
||||
end
|
||||
end
|
@@ -0,0 +1,9 @@
|
||||
class RemoveFileRelatedColumnsFromExercises < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :exercises, :reference_implementation, :text
|
||||
remove_column :exercises, :supports_user_defined_tests, :boolean
|
||||
remove_column :exercises, :template_code, :text
|
||||
remove_column :exercises, :template_test_code, :text
|
||||
remove_column :exercises, :test_code, :text
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class RemoveCodeFromSubmissions < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :submissions, :code, :text
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddInstructionsToExercises < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :exercises, :instructions, :text
|
||||
end
|
||||
end
|
5
db/migrate/20140821064318_add_published_to_exercises.rb
Normal file
5
db/migrate/20140821064318_add_published_to_exercises.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddPublishedToExercises < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :exercises, :published, :boolean
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddExecutableToFileTypes < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :file_types, :executable, :boolean
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddRenderableToFileTypes < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :file_types, :renderable, :boolean
|
||||
end
|
||||
end
|
11
db/migrate/20140825121336_create_external_users.rb
Normal file
11
db/migrate/20140825121336_create_external_users.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateExternalUsers < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :external_users do |t|
|
||||
t.belongs_to :consumer
|
||||
t.string :email
|
||||
t.string :external_id
|
||||
t.string :name
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
11
db/migrate/20140825125801_create_internal_users.rb
Normal file
11
db/migrate/20140825125801_create_internal_users.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateInternalUsers < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :internal_users do |t|
|
||||
t.belongs_to :consumer
|
||||
t.string :email
|
||||
t.string :name
|
||||
t.string :role
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
5
db/migrate/20140825154202_drop_users.rb
Normal file
5
db/migrate/20140825154202_drop_users.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class DropUsers < ActiveRecord::Migration
|
||||
def change
|
||||
drop_table :users
|
||||
end
|
||||
end
|
5
db/migrate/20140825161350_add_user_type_to_exercises.rb
Normal file
5
db/migrate/20140825161350_add_user_type_to_exercises.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddUserTypeToExercises < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :exercises, :user_type, :string
|
||||
end
|
||||
end
|
5
db/migrate/20140825161358_add_user_type_to_file_types.rb
Normal file
5
db/migrate/20140825161358_add_user_type_to_file_types.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddUserTypeToFileTypes < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :file_types, :user_type, :string
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddUserTypeToSubmissions < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :submissions, :user_type, :string
|
||||
end
|
||||
end
|
8
db/migrate/20140826073318_sorcery_core.rb
Normal file
8
db/migrate/20140826073318_sorcery_core.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class SorceryCore < ActiveRecord::Migration
|
||||
def change
|
||||
InternalUser.delete_all
|
||||
add_column :internal_users, :crypted_password, :string, null: false
|
||||
add_column :internal_users, :salt, :string, null: false
|
||||
add_index :internal_users, :email, unique: true
|
||||
end
|
||||
end
|
@@ -0,0 +1,7 @@
|
||||
class SorceryBruteForceProtection < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :internal_users, :failed_logins_count, :integer, default: 0
|
||||
add_column :internal_users, :lock_expires_at, :datetime, default: nil
|
||||
add_column :internal_users, :unlock_token, :string, default: nil
|
||||
end
|
||||
end
|
7
db/migrate/20140826073320_sorcery_remember_me.rb
Normal file
7
db/migrate/20140826073320_sorcery_remember_me.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class SorceryRememberMe < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :internal_users, :remember_me_token, :string, default: nil
|
||||
add_column :internal_users, :remember_me_token_expires_at, :datetime, default: nil
|
||||
add_index :internal_users, :remember_me_token
|
||||
end
|
||||
end
|
8
db/migrate/20140826073321_sorcery_reset_password.rb
Normal file
8
db/migrate/20140826073321_sorcery_reset_password.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class SorceryResetPassword < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :internal_users, :reset_password_token, :string, default: nil
|
||||
add_column :internal_users, :reset_password_token_expires_at, :datetime, default: nil
|
||||
add_column :internal_users, :reset_password_email_sent_at, :datetime, default: nil
|
||||
add_index :internal_users, :reset_password_token
|
||||
end
|
||||
end
|
8
db/migrate/20140826073322_sorcery_user_activation.rb
Normal file
8
db/migrate/20140826073322_sorcery_user_activation.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class SorceryUserActivation < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :internal_users, :activation_state, :string, default: nil
|
||||
add_column :internal_users, :activation_token, :string, default: nil
|
||||
add_column :internal_users, :activation_token_expires_at, :datetime, default: nil
|
||||
add_index :internal_users, :activation_token
|
||||
end
|
||||
end
|
5
db/migrate/20140827065359_add_binary_to_file_types.rb
Normal file
5
db/migrate/20140827065359_add_binary_to_file_types.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddBinaryToFileTypes < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :file_types, :binary, :boolean
|
||||
end
|
||||
end
|
5
db/migrate/20140827083957_add_native_file_to_files.rb
Normal file
5
db/migrate/20140827083957_add_native_file_to_files.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddNativeFileToFiles < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :files, :native_file, :string
|
||||
end
|
||||
end
|
12
db/migrate/20140829141913_create_hints.rb
Normal file
12
db/migrate/20140829141913_create_hints.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateHints < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :hints do |t|
|
||||
t.belongs_to :execution_environment
|
||||
t.string :locale
|
||||
t.text :message
|
||||
t.string :name
|
||||
t.string :regular_expression
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@@ -0,0 +1,6 @@
|
||||
class RemoveNotNullConstraintsFromInternalUsers < ActiveRecord::Migration
|
||||
def change
|
||||
change_column_null(:internal_users, :crypted_password, true)
|
||||
change_column_null(:internal_users, :salt, true)
|
||||
end
|
||||
end
|
9
db/migrate/20140903165113_create_errors.rb
Normal file
9
db/migrate/20140903165113_create_errors.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class CreateErrors < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :errors do |t|
|
||||
t.belongs_to :execution_environment
|
||||
t.text :message
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
5
db/migrate/20140904082810_add_token_to_exercises.rb
Normal file
5
db/migrate/20140904082810_add_token_to_exercises.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddTokenToExercises < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :exercises, :token, :string
|
||||
end
|
||||
end
|
5
db/migrate/20140909115430_add_file_id_to_exercises.rb
Normal file
5
db/migrate/20140909115430_add_file_id_to_exercises.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddFileIdToExercises < ActiveRecord::Migration
|
||||
def change
|
||||
add_reference :exercises, :file
|
||||
end
|
||||
end
|
5
db/migrate/20140915095420_add_role_to_files.rb
Normal file
5
db/migrate/20140915095420_add_role_to_files.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddRoleToFiles < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :files, :role, :string
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class RemoveFileIdFromExercises < ActiveRecord::Migration
|
||||
def change
|
||||
remove_reference :exercises, :file
|
||||
end
|
||||
end
|
11
db/migrate/20140918063522_add_hashed_content_to_files.rb
Normal file
11
db/migrate/20140918063522_add_hashed_content_to_files.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class AddHashedContentToFiles < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :files, :hashed_content, :string
|
||||
|
||||
reversible do |direction|
|
||||
direction.up do
|
||||
CodeOcean::File.all.each(&:save)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddFeedbackMessageToFiles < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :files, :feedback_message, :string
|
||||
end
|
||||
end
|
5
db/migrate/20140922161226_add_weight_to_files.rb
Normal file
5
db/migrate/20140922161226_add_weight_to_files.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddWeightToFiles < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :files, :weight, :float
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddHelpToExecutionEnvironments < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :execution_environments, :help, :text
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddExposedPortsToExecutionEnvironments < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :execution_environments, :exposed_ports, :string
|
||||
end
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
class AddPermittedExecutionTimeToExecutionEnvironments < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :execution_environments, :permitted_execution_time, :integer
|
||||
end
|
||||
end
|
@@ -0,0 +1,6 @@
|
||||
class AddUserIdAndUserTypeToExecutionEnvironments < ActiveRecord::Migration
|
||||
def change
|
||||
add_reference :execution_environments, :user
|
||||
add_column :execution_environments, :user_type, :string
|
||||
end
|
||||
end
|
5
db/migrate/20141017110211_rename_published_to_public.rb
Normal file
5
db/migrate/20141017110211_rename_published_to_public.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class RenamePublishedToPublic < ActiveRecord::Migration
|
||||
def change
|
||||
rename_column :exercises, :published, :public
|
||||
end
|
||||
end
|
5
db/migrate/20141031161603_add_path_to_files.rb
Normal file
5
db/migrate/20141031161603_add_path_to_files.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddPathToFiles < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :files, :path, :string
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user