transferred Code Ocean from original repository to GitHub

This commit is contained in:
Hauke Klement
2015-01-22 09:51:49 +01:00
commit 4cbf9970b1
683 changed files with 11979 additions and 0 deletions

View 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

View 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

View 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

View File

@@ -0,0 +1,5 @@
class AddReferenceImplementationToExercises < ActiveRecord::Migration
def change
add_column :exercises, :reference_implementation, :text
end
end

View File

@@ -0,0 +1,5 @@
class AddIndentSizeToExecutionEnvironments < ActiveRecord::Migration
def change
add_column :execution_environments, :indent_size, :integer
end
end

View File

@@ -0,0 +1,8 @@
class CreateConsumers < ActiveRecord::Migration
def change
create_table :consumers do |t|
t.string :name
t.timestamps
end
end
end

View 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

View File

@@ -0,0 +1,5 @@
class AddOauthKeyToConsumers < ActiveRecord::Migration
def change
add_column :consumers, :oauth_key, :string
end
end

View File

@@ -0,0 +1,5 @@
class AddOauthSecretToConsumers < ActiveRecord::Migration
def change
add_column :consumers, :oauth_secret, :string
end
end

View File

@@ -0,0 +1,5 @@
class AddRoleToUsers < ActiveRecord::Migration
def change
add_column :users, :role, :string
end
end

View File

@@ -0,0 +1,5 @@
class AddUserIdToExercises < ActiveRecord::Migration
def change
add_reference :exercises, :user
end
end

View File

@@ -0,0 +1,5 @@
class AddRunCommandToExecutionEnvironments < ActiveRecord::Migration
def change
add_column :execution_environments, :run_command, :string
end
end

View File

@@ -0,0 +1,5 @@
class AddTestCommandToExecutionEnvironments < ActiveRecord::Migration
def change
add_column :execution_environments, :test_command, :string
end
end

View File

@@ -0,0 +1,5 @@
class AddTestCodeToExercises < ActiveRecord::Migration
def change
add_column :exercises, :test_code, :text
end
end

View File

@@ -0,0 +1,5 @@
class AddCauseToSubmissions < ActiveRecord::Migration
def change
add_column :submissions, :cause, :string
end
end

View File

@@ -0,0 +1,5 @@
class AddTemplateTestCodeToExercises < ActiveRecord::Migration
def change
add_column :exercises, :template_test_code, :text
end
end

View File

@@ -0,0 +1,5 @@
class AddSupportsUserDefinedTestsToExercises < ActiveRecord::Migration
def change
add_column :exercises, :supports_user_defined_tests, :boolean
end
end

View File

@@ -0,0 +1,5 @@
class AddTestingFrameworkToExecutionEnvironments < ActiveRecord::Migration
def change
add_column :execution_environments, :testing_framework, :string
end
end

View 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

View 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

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,5 @@
class RemoveCodeFromSubmissions < ActiveRecord::Migration
def change
remove_column :submissions, :code, :text
end
end

View File

@@ -0,0 +1,5 @@
class AddInstructionsToExercises < ActiveRecord::Migration
def change
add_column :exercises, :instructions, :text
end
end

View File

@@ -0,0 +1,5 @@
class AddPublishedToExercises < ActiveRecord::Migration
def change
add_column :exercises, :published, :boolean
end
end

View File

@@ -0,0 +1,5 @@
class AddExecutableToFileTypes < ActiveRecord::Migration
def change
add_column :file_types, :executable, :boolean
end
end

View File

@@ -0,0 +1,5 @@
class AddRenderableToFileTypes < ActiveRecord::Migration
def change
add_column :file_types, :renderable, :boolean
end
end

View 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

View 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

View File

@@ -0,0 +1,5 @@
class DropUsers < ActiveRecord::Migration
def change
drop_table :users
end
end

View File

@@ -0,0 +1,5 @@
class AddUserTypeToExercises < ActiveRecord::Migration
def change
add_column :exercises, :user_type, :string
end
end

View File

@@ -0,0 +1,5 @@
class AddUserTypeToFileTypes < ActiveRecord::Migration
def change
add_column :file_types, :user_type, :string
end
end

View File

@@ -0,0 +1,5 @@
class AddUserTypeToSubmissions < ActiveRecord::Migration
def change
add_column :submissions, :user_type, :string
end
end

View 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

View File

@@ -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

View 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

View 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

View 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

View File

@@ -0,0 +1,5 @@
class AddBinaryToFileTypes < ActiveRecord::Migration
def change
add_column :file_types, :binary, :boolean
end
end

View File

@@ -0,0 +1,5 @@
class AddNativeFileToFiles < ActiveRecord::Migration
def change
add_column :files, :native_file, :string
end
end

View 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

View File

@@ -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

View 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

View File

@@ -0,0 +1,5 @@
class AddTokenToExercises < ActiveRecord::Migration
def change
add_column :exercises, :token, :string
end
end

View File

@@ -0,0 +1,5 @@
class AddFileIdToExercises < ActiveRecord::Migration
def change
add_reference :exercises, :file
end
end

View File

@@ -0,0 +1,5 @@
class AddRoleToFiles < ActiveRecord::Migration
def change
add_column :files, :role, :string
end
end

View File

@@ -0,0 +1,5 @@
class RemoveFileIdFromExercises < ActiveRecord::Migration
def change
remove_reference :exercises, :file
end
end

View 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

View File

@@ -0,0 +1,5 @@
class AddFeedbackMessageToFiles < ActiveRecord::Migration
def change
add_column :files, :feedback_message, :string
end
end

View File

@@ -0,0 +1,5 @@
class AddWeightToFiles < ActiveRecord::Migration
def change
add_column :files, :weight, :float
end
end

View File

@@ -0,0 +1,5 @@
class AddHelpToExecutionEnvironments < ActiveRecord::Migration
def change
add_column :execution_environments, :help, :text
end
end

View File

@@ -0,0 +1,5 @@
class AddExposedPortsToExecutionEnvironments < ActiveRecord::Migration
def change
add_column :execution_environments, :exposed_ports, :string
end
end

View File

@@ -0,0 +1,5 @@
class AddPermittedExecutionTimeToExecutionEnvironments < ActiveRecord::Migration
def change
add_column :execution_environments, :permitted_execution_time, :integer
end
end

View File

@@ -0,0 +1,6 @@
class AddUserIdAndUserTypeToExecutionEnvironments < ActiveRecord::Migration
def change
add_reference :execution_environments, :user
add_column :execution_environments, :user_type, :string
end
end

View File

@@ -0,0 +1,5 @@
class RenamePublishedToPublic < ActiveRecord::Migration
def change
rename_column :exercises, :published, :public
end
end

View File

@@ -0,0 +1,5 @@
class AddPathToFiles < ActiveRecord::Migration
def change
add_column :files, :path, :string
end
end