summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-08-25 18:42:46 -0700
committerDouwe Maan <douwe@gitlab.com>2015-08-25 18:42:46 -0700
commit046b28312704f3131e72dcd2dbdacc5264d4aa62 (patch)
treea8c2b14a6e1db3b662fee2c79af70d9fcb643c2e /db
parente449426a4e7d15cdd582d4f136add52cbfb5e04e (diff)
downloadgitlab-ce-046b28312704f3131e72dcd2dbdacc5264d4aa62.tar.gz
Groundwork for merging CI into CE
Diffstat (limited to 'db')
-rw-r--r--db/ci/migrate/20121004140911_create_projects.rb14
-rw-r--r--db/ci/migrate/20121004165038_create_builds.rb15
-rw-r--r--db/ci/migrate/20121101091638_devise_create_users.rb46
-rw-r--r--db/ci/migrate/20121101121639_add_token_to_project.rb5
-rw-r--r--db/ci/migrate/20121106143042_add_ref_functionality.rb10
-rw-r--r--db/ci/migrate/20121108160657_add_gitlab_url_to_project.rb5
-rw-r--r--db/ci/migrate/20121108174237_add_started_at_to_build.rb5
-rw-r--r--db/ci/migrate/20121115094430_increate_trace_colunm_limit.rb8
-rw-r--r--db/ci/migrate/20121115132252_add_tmp_file_to_build.rb5
-rw-r--r--db/ci/migrate/20121116144312_add_before_sha_to_build.rb5
-rw-r--r--db/ci/migrate/20121224092350_add_schedule_to_projects.rb6
-rw-r--r--db/ci/migrate/20130114153451_change_schedule_invertal.rb25
-rw-r--r--db/ci/migrate/20130129121754_add_public_flag_to_project.rb5
-rw-r--r--db/ci/migrate/20130531112551_add_data_field_to_build.rb5
-rw-r--r--db/ci/migrate/20130531122131_remove_path_field_from_project.rb8
-rw-r--r--db/ci/migrate/20130531125905_create_runners.rb10
-rw-r--r--db/ci/migrate/20130531133603_add_runner_id_to_build.rb5
-rw-r--r--db/ci/migrate/20130603130920_remove_users_table.rb5
-rw-r--r--db/ci/migrate/20130603144030_add_more_fields_to_project.rb5
-rw-r--r--db/ci/migrate/20130603144959_create_runner_projects.rb10
-rw-r--r--db/ci/migrate/20130603161449_add_project_gitlab_id_to_project.rb5
-rw-r--r--db/ci/migrate/20130628142321_add_index_project_id_to_builds.rb5
-rw-r--r--db/ci/migrate/20130705171042_add_description_to_runner.rb5
-rw-r--r--db/ci/migrate/20130710164015_add_db_index.rb7
-rw-r--r--db/ci/migrate/20130816201200_change_push_data_limit.rb5
-rw-r--r--db/ci/migrate/20130906175737_add_sessions_table.rb12
-rw-r--r--db/ci/migrate/20131023103430_add_allow_git_fetch_to_project.rb5
-rw-r--r--db/ci/migrate/20131120155545_add_email_notification_fields_to_project.rb7
-rw-r--r--db/ci/migrate/20140130121538_rename_project_fields.rb5
-rw-r--r--db/ci/migrate/20140222210357_create_web_hook.rb9
-rw-r--r--db/ci/migrate/20140506091853_remove_public_key_from_runner.rb5
-rw-r--r--db/ci/migrate/20140823225019_create_commits_from_builds.rb22
-rw-r--r--db/ci/migrate/20140909142245_add_skip_refs_to_projects.rb5
-rw-r--r--db/ci/migrate/20141001125939_add_coverage_parser.rb5
-rw-r--r--db/ci/migrate/20141001132129_add_coverage_to_build.rb5
-rw-r--r--db/ci/migrate/20141028162820_add_sha_index_to_build.rb6
-rw-r--r--db/ci/migrate/20141031114419_migrate_build_to_commits.rb21
-rw-r--r--db/ci/migrate/20141031141708_add_commit_indicies.rb9
-rw-r--r--db/ci/migrate/20141103135037_add_parallel_to_build.rb12
-rw-r--r--db/ci/migrate/20141103151359_add_commands_to_build.rb5
-rw-r--r--db/ci/migrate/20141103162726_add_job_id_to_build.rb5
-rw-r--r--db/ci/migrate/20141104130024_migrate_jobs.rb12
-rw-r--r--db/ci/migrate/20141104153744_add_name_to_job.rb5
-rw-r--r--db/ci/migrate/20141127153745_remove_scripts_from_project.rb5
-rw-r--r--db/ci/migrate/20141201153755_remove_invalid_build.rb5
-rw-r--r--db/ci/migrate/20141204133321_create_service.rb15
-rw-r--r--db/ci/migrate/20150111062026_add_filter_to_jobs.rb6
-rw-r--r--db/ci/migrate/20150113001832_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb31
-rw-r--r--db/ci/migrate/20150113001833_add_missing_unique_indices.acts_as_taggable_on_engine.rb20
-rw-r--r--db/ci/migrate/20150113001834_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb15
-rw-r--r--db/ci/migrate/20150113001835_add_missing_taggable_index.acts_as_taggable_on_engine.rb10
-rw-r--r--db/ci/migrate/20150204001035_build_missing_services.rb21
-rw-r--r--db/ci/migrate/20150226001835_add_job_type_to_job.rb6
-rw-r--r--db/ci/migrate/20150306131416_add_contacted_at_to_runner.rb5
-rw-r--r--db/ci/migrate/20150306135341_add_active_to_runner.rb5
-rw-r--r--db/ci/migrate/20150310001733_rename_committer_to_pusher.rb5
-rw-r--r--db/ci/migrate/20150320001810_create_event_table.rb16
-rw-r--r--db/ci/migrate/20150324001123_add_settings_for_shared_runners.rb6
-rw-r--r--db/ci/migrate/20150324001227_migrate_shared_runners.rb11
-rw-r--r--db/ci/migrate/20150330001111_disable_shared_runners.rb8
-rw-r--r--db/ci/migrate/20150415142013_add_deleted_at_to_jobs.rb6
-rw-r--r--db/ci/migrate/20150417000045_cleanup_the_build_model.rb9
-rw-r--r--db/ci/migrate/20150504010150_migrate_url_to_path.rb11
-rw-r--r--db/ci/migrate/20150504010250_rename_gitlab_url_to_path.rb5
-rw-r--r--db/ci/migrate/20150508011360_add_info_fields_to_runner.rb9
-rw-r--r--db/ci/migrate/20150528011001_add_fields_to_builds.rb6
-rw-r--r--db/ci/migrate/20150528011012_move_job_name_to_build.rb10
-rw-r--r--db/ci/migrate/20150529012113_add_tag_to_commits.rb5
-rw-r--r--db/ci/migrate/20150601043220_add_yaml_to_projects.rb9
-rw-r--r--db/ci/migrate/20150601043231_migrate_jobs_to_yaml.rb97
-rw-r--r--db/ci/migrate/20150602000240_change_default_build_timeout.rb9
-rw-r--r--db/ci/migrate/20150605002131_create_variables.rb11
-rw-r--r--db/ci/migrate/20150616001155_add_errors_to_commit.rb5
-rw-r--r--db/ci/migrate/20150630091815_add_options_to_build.rb5
-rw-r--r--db/ci/migrate/20150703125244_add_encrypted_value_to_variables.rb7
-rw-r--r--db/ci/migrate/20150703125325_encrypt_variables.rb10
-rw-r--r--db/ci/migrate/20150707134456_add_allow_failure_to_builds.rb5
-rw-r--r--db/ci/migrate/20150710113836_add_job_type_to_builds.rb5
-rw-r--r--db/ci/migrate/20150710113851_migrate_deploy_to_job_type_for_builds.rb6
-rw-r--r--db/ci/migrate/20150721204649_truncate_sessions.rb9
-rw-r--r--db/ci/migrate/20150729145246_create_application_settings.rb10
-rw-r--r--db/ci/migrate/20150803142346_rename_job_type_to_stage_builds.rb9
-rw-r--r--db/ci/migrate/20150806091503_add_committed_at_to_commits.rb6
-rw-r--r--db/ci/migrate/20150806091655_update_committed_at_with_created_at.rb5
-rw-r--r--db/ci/migrate/20150806102222_create_trigger.rb12
-rw-r--r--db/ci/migrate/20150806102457_add_trigger_to_builds.rb5
-rw-r--r--db/ci/migrate/20150806105404_create_trigger_request.rb9
-rw-r--r--db/ci/migrate/20150819162227_add_commit_id_to_trigger_requests.rb8
-rw-r--r--db/ci/schema.rb226
-rw-r--r--db/ci/seeds.rb0
-rw-r--r--db/migrate/20150826001931_add_ci_tables.rb190
-rw-r--r--db/migrate/limits_to_mysql.rb4
-rw-r--r--db/schema.rb334
93 files changed, 1592 insertions, 39 deletions
diff --git a/db/ci/migrate/20121004140911_create_projects.rb b/db/ci/migrate/20121004140911_create_projects.rb
new file mode 100644
index 00000000000..a9fee3aa6c8
--- /dev/null
+++ b/db/ci/migrate/20121004140911_create_projects.rb
@@ -0,0 +1,14 @@
+class CreateProjects < ActiveRecord::Migration
+ def up
+ create_table :projects do |t|
+ t.string :name, null: false
+ t.string :path, null: false
+ t.integer :timeout, null: false, default: 1800
+ t.text :scripts, null: false
+ t.timestamps
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/ci/migrate/20121004165038_create_builds.rb b/db/ci/migrate/20121004165038_create_builds.rb
new file mode 100644
index 00000000000..547803489fb
--- /dev/null
+++ b/db/ci/migrate/20121004165038_create_builds.rb
@@ -0,0 +1,15 @@
+class CreateBuilds < ActiveRecord::Migration
+ def up
+ create_table :builds do |t|
+ t.integer :project_id
+ t.string :commit_ref
+ t.string :status
+ t.datetime :finished_at
+ t.text :trace
+ t.timestamps
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/ci/migrate/20121101091638_devise_create_users.rb b/db/ci/migrate/20121101091638_devise_create_users.rb
new file mode 100644
index 00000000000..2099d998fa4
--- /dev/null
+++ b/db/ci/migrate/20121101091638_devise_create_users.rb
@@ -0,0 +1,46 @@
+class DeviseCreateUsers < ActiveRecord::Migration
+ def change
+ create_table(:users) do |t|
+ ## Database authenticatable
+ t.string :email, :null => false, :default => ""
+ t.string :encrypted_password, :null => false, :default => ""
+
+ ## Recoverable
+ t.string :reset_password_token
+ t.datetime :reset_password_sent_at
+
+ ## Rememberable
+ t.datetime :remember_created_at
+
+ ## Trackable
+ 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
+ t.string :last_sign_in_ip
+
+ ## Confirmable
+ # t.string :confirmation_token
+ # t.datetime :confirmed_at
+ # t.datetime :confirmation_sent_at
+ # t.string :unconfirmed_email # Only if using reconfirmable
+
+ ## Lockable
+ # t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
+ # t.datetime :locked_at
+
+ ## Token authenticatable
+ # t.string :authentication_token
+
+
+ t.timestamps
+ end
+
+ add_index :users, :email, :unique => true
+ add_index :users, :reset_password_token, :unique => true
+ # add_index :users, :confirmation_token, :unique => true
+ # add_index :users, :unlock_token, :unique => true
+ # add_index :users, :authentication_token, :unique => true
+ end
+end
diff --git a/db/ci/migrate/20121101121639_add_token_to_project.rb b/db/ci/migrate/20121101121639_add_token_to_project.rb
new file mode 100644
index 00000000000..bb66677b6b1
--- /dev/null
+++ b/db/ci/migrate/20121101121639_add_token_to_project.rb
@@ -0,0 +1,5 @@
+class AddTokenToProject < ActiveRecord::Migration
+ def change
+ add_column :projects, :token, :string, null: true
+ end
+end
diff --git a/db/ci/migrate/20121106143042_add_ref_functionality.rb b/db/ci/migrate/20121106143042_add_ref_functionality.rb
new file mode 100644
index 00000000000..0c26571e305
--- /dev/null
+++ b/db/ci/migrate/20121106143042_add_ref_functionality.rb
@@ -0,0 +1,10 @@
+class AddRefFunctionality < ActiveRecord::Migration
+ def change
+ rename_column :builds, :commit_ref, :ref
+ add_column :builds, :sha, :string
+ add_column :projects, :default_ref, :string
+ end
+
+ def down
+ end
+end
diff --git a/db/ci/migrate/20121108160657_add_gitlab_url_to_project.rb b/db/ci/migrate/20121108160657_add_gitlab_url_to_project.rb
new file mode 100644
index 00000000000..8a4e8fd666f
--- /dev/null
+++ b/db/ci/migrate/20121108160657_add_gitlab_url_to_project.rb
@@ -0,0 +1,5 @@
+class AddGitlabUrlToProject < ActiveRecord::Migration
+ def change
+ add_column :projects, :gitlab_url, :string, null: true
+ end
+end
diff --git a/db/ci/migrate/20121108174237_add_started_at_to_build.rb b/db/ci/migrate/20121108174237_add_started_at_to_build.rb
new file mode 100644
index 00000000000..b4d65c75004
--- /dev/null
+++ b/db/ci/migrate/20121108174237_add_started_at_to_build.rb
@@ -0,0 +1,5 @@
+class AddStartedAtToBuild < ActiveRecord::Migration
+ def change
+ add_column :builds, :started_at, :datetime, null: true
+ end
+end
diff --git a/db/ci/migrate/20121115094430_increate_trace_colunm_limit.rb b/db/ci/migrate/20121115094430_increate_trace_colunm_limit.rb
new file mode 100644
index 00000000000..5853f440f59
--- /dev/null
+++ b/db/ci/migrate/20121115094430_increate_trace_colunm_limit.rb
@@ -0,0 +1,8 @@
+class IncreateTraceColunmLimit < ActiveRecord::Migration
+ def up
+ change_column :builds, :trace, :text, :limit => 1073741823
+ end
+
+ def down
+ end
+end
diff --git a/db/ci/migrate/20121115132252_add_tmp_file_to_build.rb b/db/ci/migrate/20121115132252_add_tmp_file_to_build.rb
new file mode 100644
index 00000000000..a9a4e36b5ba
--- /dev/null
+++ b/db/ci/migrate/20121115132252_add_tmp_file_to_build.rb
@@ -0,0 +1,5 @@
+class AddTmpFileToBuild < ActiveRecord::Migration
+ def change
+ add_column :builds, :tmp_file, :string
+ end
+end
diff --git a/db/ci/migrate/20121116144312_add_before_sha_to_build.rb b/db/ci/migrate/20121116144312_add_before_sha_to_build.rb
new file mode 100644
index 00000000000..7b8cfd93caa
--- /dev/null
+++ b/db/ci/migrate/20121116144312_add_before_sha_to_build.rb
@@ -0,0 +1,5 @@
+class AddBeforeShaToBuild < ActiveRecord::Migration
+ def change
+ add_column :builds, :before_sha, :string, null: true
+ end
+end
diff --git a/db/ci/migrate/20121224092350_add_schedule_to_projects.rb b/db/ci/migrate/20121224092350_add_schedule_to_projects.rb
new file mode 100644
index 00000000000..fb3155f1159
--- /dev/null
+++ b/db/ci/migrate/20121224092350_add_schedule_to_projects.rb
@@ -0,0 +1,6 @@
+class AddScheduleToProjects < ActiveRecord::Migration
+ def change
+ add_column :projects, :always_build, :boolean, default: false, null: false
+ add_column :projects, :polling_interval, :string, null: true
+ end
+end
diff --git a/db/ci/migrate/20130114153451_change_schedule_invertal.rb b/db/ci/migrate/20130114153451_change_schedule_invertal.rb
new file mode 100644
index 00000000000..accf3eef473
--- /dev/null
+++ b/db/ci/migrate/20130114153451_change_schedule_invertal.rb
@@ -0,0 +1,25 @@
+class ChangeScheduleInvertal < ActiveRecord::Migration
+ def up
+ if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
+ connection.execute(%q{
+ ALTER TABLE projects
+ ALTER COLUMN polling_interval
+ TYPE integer USING CAST(polling_interval AS integer)
+ })
+ else
+ change_column :projects, :polling_interval, :integer, null: true
+ end
+ end
+
+ def down
+ if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
+ connection.execute(%q{
+ ALTER TABLE projects
+ ALTER COLUMN polling_interval
+ TYPE integer USING CAST(polling_interval AS varchar)
+ })
+ else
+ change_column :projects, :polling_interval, :string, null: true
+ end
+ end
+end
diff --git a/db/ci/migrate/20130129121754_add_public_flag_to_project.rb b/db/ci/migrate/20130129121754_add_public_flag_to_project.rb
new file mode 100644
index 00000000000..2bfe52f0df4
--- /dev/null
+++ b/db/ci/migrate/20130129121754_add_public_flag_to_project.rb
@@ -0,0 +1,5 @@
+class AddPublicFlagToProject < ActiveRecord::Migration
+ def change
+ add_column :projects, :public, :boolean, null: false, default: false
+ end
+end
diff --git a/db/ci/migrate/20130531112551_add_data_field_to_build.rb b/db/ci/migrate/20130531112551_add_data_field_to_build.rb
new file mode 100644
index 00000000000..ff897bce448
--- /dev/null
+++ b/db/ci/migrate/20130531112551_add_data_field_to_build.rb
@@ -0,0 +1,5 @@
+class AddDataFieldToBuild < ActiveRecord::Migration
+ def change
+ add_column :builds, :push_data, :text
+ end
+end
diff --git a/db/ci/migrate/20130531122131_remove_path_field_from_project.rb b/db/ci/migrate/20130531122131_remove_path_field_from_project.rb
new file mode 100644
index 00000000000..684c16470a4
--- /dev/null
+++ b/db/ci/migrate/20130531122131_remove_path_field_from_project.rb
@@ -0,0 +1,8 @@
+class RemovePathFieldFromProject < ActiveRecord::Migration
+ def up
+ remove_column :projects, :path
+ end
+
+ def down
+ end
+end
diff --git a/db/ci/migrate/20130531125905_create_runners.rb b/db/ci/migrate/20130531125905_create_runners.rb
new file mode 100644
index 00000000000..2619394f51b
--- /dev/null
+++ b/db/ci/migrate/20130531125905_create_runners.rb
@@ -0,0 +1,10 @@
+class CreateRunners < ActiveRecord::Migration
+ def change
+ create_table :runners do |t|
+ t.string :token
+ t.text :public_key
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/ci/migrate/20130531133603_add_runner_id_to_build.rb b/db/ci/migrate/20130531133603_add_runner_id_to_build.rb
new file mode 100644
index 00000000000..bccc0970835
--- /dev/null
+++ b/db/ci/migrate/20130531133603_add_runner_id_to_build.rb
@@ -0,0 +1,5 @@
+class AddRunnerIdToBuild < ActiveRecord::Migration
+ def change
+ add_column :builds, :runner_id, :integer
+ end
+end
diff --git a/db/ci/migrate/20130603130920_remove_users_table.rb b/db/ci/migrate/20130603130920_remove_users_table.rb
new file mode 100644
index 00000000000..6948ef265ef
--- /dev/null
+++ b/db/ci/migrate/20130603130920_remove_users_table.rb
@@ -0,0 +1,5 @@
+class RemoveUsersTable < ActiveRecord::Migration
+ def up
+ drop_table :users
+ end
+end
diff --git a/db/ci/migrate/20130603144030_add_more_fields_to_project.rb b/db/ci/migrate/20130603144030_add_more_fields_to_project.rb
new file mode 100644
index 00000000000..0897682285a
--- /dev/null
+++ b/db/ci/migrate/20130603144030_add_more_fields_to_project.rb
@@ -0,0 +1,5 @@
+class AddMoreFieldsToProject < ActiveRecord::Migration
+ def change
+ add_column :projects, :ssh_url_to_repo, :string
+ end
+end
diff --git a/db/ci/migrate/20130603144959_create_runner_projects.rb b/db/ci/migrate/20130603144959_create_runner_projects.rb
new file mode 100644
index 00000000000..c65c8a51bcf
--- /dev/null
+++ b/db/ci/migrate/20130603144959_create_runner_projects.rb
@@ -0,0 +1,10 @@
+class CreateRunnerProjects < ActiveRecord::Migration
+ def change
+ create_table :runner_projects do |t|
+ t.integer :runner_id, null: false
+ t.integer :project_id, null: false
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/ci/migrate/20130603161449_add_project_gitlab_id_to_project.rb b/db/ci/migrate/20130603161449_add_project_gitlab_id_to_project.rb
new file mode 100644
index 00000000000..3efdbb7af1c
--- /dev/null
+++ b/db/ci/migrate/20130603161449_add_project_gitlab_id_to_project.rb
@@ -0,0 +1,5 @@
+class AddProjectGitlabIdToProject < ActiveRecord::Migration
+ def change
+ add_column :projects, :gitlab_id, :integer
+ end
+end
diff --git a/db/ci/migrate/20130628142321_add_index_project_id_to_builds.rb b/db/ci/migrate/20130628142321_add_index_project_id_to_builds.rb
new file mode 100644
index 00000000000..5f968b06b5d
--- /dev/null
+++ b/db/ci/migrate/20130628142321_add_index_project_id_to_builds.rb
@@ -0,0 +1,5 @@
+class AddIndexProjectIdToBuilds < ActiveRecord::Migration
+ def change
+ add_index :builds, :project_id
+ end
+end
diff --git a/db/ci/migrate/20130705171042_add_description_to_runner.rb b/db/ci/migrate/20130705171042_add_description_to_runner.rb
new file mode 100644
index 00000000000..1e04e98d109
--- /dev/null
+++ b/db/ci/migrate/20130705171042_add_description_to_runner.rb
@@ -0,0 +1,5 @@
+class AddDescriptionToRunner < ActiveRecord::Migration
+ def change
+ add_column :runners, :description, :string
+ end
+end
diff --git a/db/ci/migrate/20130710164015_add_db_index.rb b/db/ci/migrate/20130710164015_add_db_index.rb
new file mode 100644
index 00000000000..4907fae888b
--- /dev/null
+++ b/db/ci/migrate/20130710164015_add_db_index.rb
@@ -0,0 +1,7 @@
+class AddDbIndex < ActiveRecord::Migration
+ def change
+ add_index :builds, :runner_id
+ add_index :runner_projects, :runner_id
+ add_index :runner_projects, :project_id
+ end
+end
diff --git a/db/ci/migrate/20130816201200_change_push_data_limit.rb b/db/ci/migrate/20130816201200_change_push_data_limit.rb
new file mode 100644
index 00000000000..29bd45c2cf9
--- /dev/null
+++ b/db/ci/migrate/20130816201200_change_push_data_limit.rb
@@ -0,0 +1,5 @@
+class ChangePushDataLimit < ActiveRecord::Migration
+ def change
+ change_column :builds, :push_data, :text, :limit => 16777215
+ end
+end
diff --git a/db/ci/migrate/20130906175737_add_sessions_table.rb b/db/ci/migrate/20130906175737_add_sessions_table.rb
new file mode 100644
index 00000000000..4c879564a58
--- /dev/null
+++ b/db/ci/migrate/20130906175737_add_sessions_table.rb
@@ -0,0 +1,12 @@
+class AddSessionsTable < ActiveRecord::Migration
+ def change
+ create_table :sessions do |t|
+ t.string :session_id, :null => false
+ t.text :data
+ t.timestamps
+ end
+
+ add_index :sessions, :session_id
+ add_index :sessions, :updated_at
+ end
+end
diff --git a/db/ci/migrate/20131023103430_add_allow_git_fetch_to_project.rb b/db/ci/migrate/20131023103430_add_allow_git_fetch_to_project.rb
new file mode 100644
index 00000000000..900ea913728
--- /dev/null
+++ b/db/ci/migrate/20131023103430_add_allow_git_fetch_to_project.rb
@@ -0,0 +1,5 @@
+class AddAllowGitFetchToProject < ActiveRecord::Migration
+ def change
+ add_column :projects, :allow_git_fetch, :boolean, default: true, null: false
+ end
+end
diff --git a/db/ci/migrate/20131120155545_add_email_notification_fields_to_project.rb b/db/ci/migrate/20131120155545_add_email_notification_fields_to_project.rb
new file mode 100644
index 00000000000..e0f4943d40f
--- /dev/null
+++ b/db/ci/migrate/20131120155545_add_email_notification_fields_to_project.rb
@@ -0,0 +1,7 @@
+class AddEmailNotificationFieldsToProject < ActiveRecord::Migration
+ def change
+ add_column :projects, :email_recipients, :string, default: '', null: false
+ add_column :projects, :email_add_committer, :boolean, default: true, null: false
+ add_column :projects, :email_all_broken_builds, :boolean, default: true, null: false
+ end
+end
diff --git a/db/ci/migrate/20140130121538_rename_project_fields.rb b/db/ci/migrate/20140130121538_rename_project_fields.rb
new file mode 100644
index 00000000000..3d7d3e8167e
--- /dev/null
+++ b/db/ci/migrate/20140130121538_rename_project_fields.rb
@@ -0,0 +1,5 @@
+class RenameProjectFields < ActiveRecord::Migration
+ def change
+ rename_column :projects, :email_all_broken_builds, :email_only_broken_builds
+ end
+end
diff --git a/db/ci/migrate/20140222210357_create_web_hook.rb b/db/ci/migrate/20140222210357_create_web_hook.rb
new file mode 100644
index 00000000000..743ad816906
--- /dev/null
+++ b/db/ci/migrate/20140222210357_create_web_hook.rb
@@ -0,0 +1,9 @@
+class CreateWebHook < ActiveRecord::Migration
+ def change
+ create_table :web_hooks do |t|
+ t.string :url, null: false
+ t.integer :project_id, null: false
+ t.timestamps
+ end
+ end
+end
diff --git a/db/ci/migrate/20140506091853_remove_public_key_from_runner.rb b/db/ci/migrate/20140506091853_remove_public_key_from_runner.rb
new file mode 100644
index 00000000000..3bf9f036ae8
--- /dev/null
+++ b/db/ci/migrate/20140506091853_remove_public_key_from_runner.rb
@@ -0,0 +1,5 @@
+class RemovePublicKeyFromRunner < ActiveRecord::Migration
+ def change
+ remove_column :runners, :public_key
+ end
+end
diff --git a/db/ci/migrate/20140823225019_create_commits_from_builds.rb b/db/ci/migrate/20140823225019_create_commits_from_builds.rb
new file mode 100644
index 00000000000..15f84b11511
--- /dev/null
+++ b/db/ci/migrate/20140823225019_create_commits_from_builds.rb
@@ -0,0 +1,22 @@
+class CreateCommitsFromBuilds < ActiveRecord::Migration
+ def change
+ create_table :commits do |t|
+ t.integer :project_id
+ t.string :ref, nil: false
+ t.string :sha, nil: false
+ t.string :before_sha, nil: false
+ t.text :push_data, nil: false
+
+ t.timestamps
+ end
+
+ add_column :builds, :commit_id, :integer
+
+ # Remove commit data from builds
+ #remove_column :builds, :project_id, :integer
+ #remove_column :builds, :ref, :string
+ #remove_column :builds, :sha, :string
+ #remove_column :builds, :before_sha, :string
+ #remove_column :builds, :push_data, :text
+ end
+end
diff --git a/db/ci/migrate/20140909142245_add_skip_refs_to_projects.rb b/db/ci/migrate/20140909142245_add_skip_refs_to_projects.rb
new file mode 100644
index 00000000000..2d7b1a223e2
--- /dev/null
+++ b/db/ci/migrate/20140909142245_add_skip_refs_to_projects.rb
@@ -0,0 +1,5 @@
+class AddSkipRefsToProjects < ActiveRecord::Migration
+ def change
+ add_column :projects, :skip_refs, :string
+ end
+end
diff --git a/db/ci/migrate/20141001125939_add_coverage_parser.rb b/db/ci/migrate/20141001125939_add_coverage_parser.rb
new file mode 100644
index 00000000000..7ea7d6047a9
--- /dev/null
+++ b/db/ci/migrate/20141001125939_add_coverage_parser.rb
@@ -0,0 +1,5 @@
+class AddCoverageParser < ActiveRecord::Migration
+ def change
+ add_column :projects, :coverage_regex, :string
+ end
+end
diff --git a/db/ci/migrate/20141001132129_add_coverage_to_build.rb b/db/ci/migrate/20141001132129_add_coverage_to_build.rb
new file mode 100644
index 00000000000..442a3dd28c0
--- /dev/null
+++ b/db/ci/migrate/20141001132129_add_coverage_to_build.rb
@@ -0,0 +1,5 @@
+class AddCoverageToBuild < ActiveRecord::Migration
+ def change
+ add_column :builds, :coverage, :float
+ end
+end
diff --git a/db/ci/migrate/20141028162820_add_sha_index_to_build.rb b/db/ci/migrate/20141028162820_add_sha_index_to_build.rb
new file mode 100644
index 00000000000..bd2a4de5657
--- /dev/null
+++ b/db/ci/migrate/20141028162820_add_sha_index_to_build.rb
@@ -0,0 +1,6 @@
+class AddShaIndexToBuild < ActiveRecord::Migration
+ def change
+ add_index :builds, :sha
+ add_index :builds, [:project_id, :sha]
+ end
+end
diff --git a/db/ci/migrate/20141031114419_migrate_build_to_commits.rb b/db/ci/migrate/20141031114419_migrate_build_to_commits.rb
new file mode 100644
index 00000000000..dc90ec6d15e
--- /dev/null
+++ b/db/ci/migrate/20141031114419_migrate_build_to_commits.rb
@@ -0,0 +1,21 @@
+class MigrateBuildToCommits < ActiveRecord::Migration
+ def change
+ execute <<eos
+INSERT INTO commits ( sha, project_id, ref, before_sha, push_data )
+SELECT sha, project_id, ref, before_sha, push_data FROM builds
+WHERE id IN (SELECT MAX(id) FROM builds GROUP BY sha)
+eos
+
+
+ if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
+ execute <<eos
+UPDATE builds
+SET commit_id = commits.id
+FROM commits
+WHERE commits.sha = builds.sha
+eos
+ else
+ execute "UPDATE builds b, commits c SET b.commit_id = c.id WHERE c.sha = b.sha"
+ end
+ end
+end
diff --git a/db/ci/migrate/20141031141708_add_commit_indicies.rb b/db/ci/migrate/20141031141708_add_commit_indicies.rb
new file mode 100644
index 00000000000..c9c0155e9b7
--- /dev/null
+++ b/db/ci/migrate/20141031141708_add_commit_indicies.rb
@@ -0,0 +1,9 @@
+class AddCommitIndicies < ActiveRecord::Migration
+ def change
+ add_index :commits, :project_id
+ add_index :commits, :sha, length: 6
+ add_index :commits, [:project_id, :sha]
+ add_index :builds, :commit_id
+ add_index :builds, [:project_id, :commit_id]
+ end
+end
diff --git a/db/ci/migrate/20141103135037_add_parallel_to_build.rb b/db/ci/migrate/20141103135037_add_parallel_to_build.rb
new file mode 100644
index 00000000000..2a3f64facf1
--- /dev/null
+++ b/db/ci/migrate/20141103135037_add_parallel_to_build.rb
@@ -0,0 +1,12 @@
+class AddParallelToBuild < ActiveRecord::Migration
+ def change
+ create_table :jobs do |t|
+ t.integer :project_id, null: false
+ t.text :commands
+ t.boolean :active, null: false, default: true
+ t.timestamps
+ end
+
+ add_index :jobs, :project_id
+ end
+end
diff --git a/db/ci/migrate/20141103151359_add_commands_to_build.rb b/db/ci/migrate/20141103151359_add_commands_to_build.rb
new file mode 100644
index 00000000000..2ef4b8ec9ce
--- /dev/null
+++ b/db/ci/migrate/20141103151359_add_commands_to_build.rb
@@ -0,0 +1,5 @@
+class AddCommandsToBuild < ActiveRecord::Migration
+ def change
+ add_column :builds, :commands, :text
+ end
+end
diff --git a/db/ci/migrate/20141103162726_add_job_id_to_build.rb b/db/ci/migrate/20141103162726_add_job_id_to_build.rb
new file mode 100644
index 00000000000..b4e3020e192
--- /dev/null
+++ b/db/ci/migrate/20141103162726_add_job_id_to_build.rb
@@ -0,0 +1,5 @@
+class AddJobIdToBuild < ActiveRecord::Migration
+ def change
+ add_column :builds, :job_id, :integer
+ end
+end
diff --git a/db/ci/migrate/20141104130024_migrate_jobs.rb b/db/ci/migrate/20141104130024_migrate_jobs.rb
new file mode 100644
index 00000000000..1d80fb836b6
--- /dev/null
+++ b/db/ci/migrate/20141104130024_migrate_jobs.rb
@@ -0,0 +1,12 @@
+class MigrateJobs < ActiveRecord::Migration
+ def up
+ Project.find_each(batch_size: 100) do |project|
+ job = project.jobs.create(commands: project.scripts)
+ project.builds.order('id DESC').limit(10).update_all(job_id: job.id)
+ end
+ end
+
+ def down
+ Job.destroy_all
+ end
+end
diff --git a/db/ci/migrate/20141104153744_add_name_to_job.rb b/db/ci/migrate/20141104153744_add_name_to_job.rb
new file mode 100644
index 00000000000..ef4dd1715e4
--- /dev/null
+++ b/db/ci/migrate/20141104153744_add_name_to_job.rb
@@ -0,0 +1,5 @@
+class AddNameToJob < ActiveRecord::Migration
+ def change
+ add_column :jobs, :name, :string
+ end
+end
diff --git a/db/ci/migrate/20141127153745_remove_scripts_from_project.rb b/db/ci/migrate/20141127153745_remove_scripts_from_project.rb
new file mode 100644
index 00000000000..d28709340f4
--- /dev/null
+++ b/db/ci/migrate/20141127153745_remove_scripts_from_project.rb
@@ -0,0 +1,5 @@
+class RemoveScriptsFromProject < ActiveRecord::Migration
+ def change
+ remove_column :projects, :scripts
+ end
+end \ No newline at end of file
diff --git a/db/ci/migrate/20141201153755_remove_invalid_build.rb b/db/ci/migrate/20141201153755_remove_invalid_build.rb
new file mode 100644
index 00000000000..a3a650359e3
--- /dev/null
+++ b/db/ci/migrate/20141201153755_remove_invalid_build.rb
@@ -0,0 +1,5 @@
+class RemoveInvalidBuild < ActiveRecord::Migration
+ def change
+ execute "DELETE FROM builds WHERE commit_id is NULL"
+ end
+end
diff --git a/db/ci/migrate/20141204133321_create_service.rb b/db/ci/migrate/20141204133321_create_service.rb
new file mode 100644
index 00000000000..d87115c0577
--- /dev/null
+++ b/db/ci/migrate/20141204133321_create_service.rb
@@ -0,0 +1,15 @@
+class CreateService < ActiveRecord::Migration
+ def change
+ create_table :services, force: true do |t|
+ t.string :type
+ t.string :title
+ t.integer :project_id, null: false
+ t.datetime :created_at
+ t.datetime :updated_at
+ t.boolean :active, default: false, null: false
+ t.text :properties
+ end
+
+ add_index :services, [:project_id], name: :index_services_on_project_id, using: :btree
+ end
+end
diff --git a/db/ci/migrate/20150111062026_add_filter_to_jobs.rb b/db/ci/migrate/20150111062026_add_filter_to_jobs.rb
new file mode 100644
index 00000000000..90e422deced
--- /dev/null
+++ b/db/ci/migrate/20150111062026_add_filter_to_jobs.rb
@@ -0,0 +1,6 @@
+class AddFilterToJobs < ActiveRecord::Migration
+ def change
+ add_column :jobs, :build_branches, :boolean, default: true, null: false
+ add_column :jobs, :build_tags, :boolean, default: false, null: false
+ end
+end
diff --git a/db/ci/migrate/20150113001832_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb b/db/ci/migrate/20150113001832_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb
new file mode 100644
index 00000000000..6bbd5594ea0
--- /dev/null
+++ b/db/ci/migrate/20150113001832_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb
@@ -0,0 +1,31 @@
+# This migration comes from acts_as_taggable_on_engine (originally 1)
+class ActsAsTaggableOnMigration < ActiveRecord::Migration
+ def self.up
+ create_table :tags do |t|
+ t.string :name
+ end
+
+ create_table :taggings do |t|
+ t.references :tag
+
+ # You should make sure that the column created is
+ # long enough to store the required class names.
+ t.references :taggable, polymorphic: true
+ t.references :tagger, polymorphic: true
+
+ # Limit is created to prevent MySQL error on index
+ # length for MyISAM table type: http://bit.ly/vgW2Ql
+ t.string :context, limit: 128
+
+ t.datetime :created_at
+ end
+
+ add_index :taggings, :tag_id
+ add_index :taggings, [:taggable_id, :taggable_type, :context]
+ end
+
+ def self.down
+ drop_table :taggings
+ drop_table :tags
+ end
+end
diff --git a/db/ci/migrate/20150113001833_add_missing_unique_indices.acts_as_taggable_on_engine.rb b/db/ci/migrate/20150113001833_add_missing_unique_indices.acts_as_taggable_on_engine.rb
new file mode 100644
index 00000000000..4ca676f6c72
--- /dev/null
+++ b/db/ci/migrate/20150113001833_add_missing_unique_indices.acts_as_taggable_on_engine.rb
@@ -0,0 +1,20 @@
+# This migration comes from acts_as_taggable_on_engine (originally 2)
+class AddMissingUniqueIndices < ActiveRecord::Migration
+ def self.up
+ add_index :tags, :name, unique: true
+
+ remove_index :taggings, :tag_id
+ remove_index :taggings, [:taggable_id, :taggable_type, :context]
+ add_index :taggings,
+ [:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type],
+ unique: true, name: 'taggings_idx'
+ end
+
+ def self.down
+ remove_index :tags, :name
+
+ remove_index :taggings, name: 'taggings_idx'
+ add_index :taggings, :tag_id
+ add_index :taggings, [:taggable_id, :taggable_type, :context]
+ end
+end
diff --git a/db/ci/migrate/20150113001834_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb b/db/ci/migrate/20150113001834_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
new file mode 100644
index 00000000000..8edb5080781
--- /dev/null
+++ b/db/ci/migrate/20150113001834_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
@@ -0,0 +1,15 @@
+# This migration comes from acts_as_taggable_on_engine (originally 3)
+class AddTaggingsCounterCacheToTags < ActiveRecord::Migration
+ def self.up
+ add_column :tags, :taggings_count, :integer, default: 0
+
+ ActsAsTaggableOn::Tag.reset_column_information
+ ActsAsTaggableOn::Tag.find_each do |tag|
+ ActsAsTaggableOn::Tag.reset_counters(tag.id, :taggings)
+ end
+ end
+
+ def self.down
+ remove_column :tags, :taggings_count
+ end
+end
diff --git a/db/ci/migrate/20150113001835_add_missing_taggable_index.acts_as_taggable_on_engine.rb b/db/ci/migrate/20150113001835_add_missing_taggable_index.acts_as_taggable_on_engine.rb
new file mode 100644
index 00000000000..71f2d7f4330
--- /dev/null
+++ b/db/ci/migrate/20150113001835_add_missing_taggable_index.acts_as_taggable_on_engine.rb
@@ -0,0 +1,10 @@
+# This migration comes from acts_as_taggable_on_engine (originally 4)
+class AddMissingTaggableIndex < ActiveRecord::Migration
+ def self.up
+ add_index :taggings, [:taggable_id, :taggable_type, :context]
+ end
+
+ def self.down
+ remove_index :taggings, [:taggable_id, :taggable_type, :context]
+ end
+end
diff --git a/db/ci/migrate/20150204001035_build_missing_services.rb b/db/ci/migrate/20150204001035_build_missing_services.rb
new file mode 100644
index 00000000000..437ad072ead
--- /dev/null
+++ b/db/ci/migrate/20150204001035_build_missing_services.rb
@@ -0,0 +1,21 @@
+class BuildMissingServices < ActiveRecord::Migration
+ def up
+ Project.find_each do |project|
+ # Slack service creation
+ slack_service = select_one("SELECT id FROM services WHERE type='SlackService' AND project_id = #{project.id}")
+
+ unless slack_service
+ execute("INSERT INTO services (type, project_id, active, properties, created_at, updated_at) \
+ VALUES ('SlackService', '#{project.id}', false, '{}', NOW(), NOW())")
+ end
+
+ # Mail service creation
+ mail_service = select_one("SELECT id FROM services WHERE type='MailService' AND project_id = #{project.id}")
+
+ unless mail_service
+ execute("INSERT INTO services (type, project_id, active, properties, created_at, updated_at) \
+ VALUES ('MailService', '#{project.id}', true, '{}', NOW(), NOW())")
+ end
+ end
+ end
+end
diff --git a/db/ci/migrate/20150226001835_add_job_type_to_job.rb b/db/ci/migrate/20150226001835_add_job_type_to_job.rb
new file mode 100644
index 00000000000..0153c87b932
--- /dev/null
+++ b/db/ci/migrate/20150226001835_add_job_type_to_job.rb
@@ -0,0 +1,6 @@
+class AddJobTypeToJob < ActiveRecord::Migration
+ def change
+ add_column :jobs, :job_type, :string, default: 'parallel'
+ add_column :jobs, :refs, :string
+ end
+end
diff --git a/db/ci/migrate/20150306131416_add_contacted_at_to_runner.rb b/db/ci/migrate/20150306131416_add_contacted_at_to_runner.rb
new file mode 100644
index 00000000000..b28f1ba5cff
--- /dev/null
+++ b/db/ci/migrate/20150306131416_add_contacted_at_to_runner.rb
@@ -0,0 +1,5 @@
+class AddContactedAtToRunner < ActiveRecord::Migration
+ def change
+ add_column :runners, :contacted_at, :datetime, null: true
+ end
+end
diff --git a/db/ci/migrate/20150306135341_add_active_to_runner.rb b/db/ci/migrate/20150306135341_add_active_to_runner.rb
new file mode 100644
index 00000000000..2b9a3dc5f30
--- /dev/null
+++ b/db/ci/migrate/20150306135341_add_active_to_runner.rb
@@ -0,0 +1,5 @@
+class AddActiveToRunner < ActiveRecord::Migration
+ def change
+ add_column :runners, :active, :boolean, null: false, default: true
+ end
+end
diff --git a/db/ci/migrate/20150310001733_rename_committer_to_pusher.rb b/db/ci/migrate/20150310001733_rename_committer_to_pusher.rb
new file mode 100644
index 00000000000..7e183673063
--- /dev/null
+++ b/db/ci/migrate/20150310001733_rename_committer_to_pusher.rb
@@ -0,0 +1,5 @@
+class RenameCommitterToPusher < ActiveRecord::Migration
+ def change
+ rename_column :projects, :email_add_committer, :email_add_pusher
+ end
+end
diff --git a/db/ci/migrate/20150320001810_create_event_table.rb b/db/ci/migrate/20150320001810_create_event_table.rb
new file mode 100644
index 00000000000..8d889ae874b
--- /dev/null
+++ b/db/ci/migrate/20150320001810_create_event_table.rb
@@ -0,0 +1,16 @@
+class CreateEventTable < ActiveRecord::Migration
+ def change
+ create_table :events do |t|
+ t.integer :project_id
+ t.integer :user_id
+ t.integer :is_admin
+ t.text :description
+
+ t.timestamps
+
+ t.index :created_at
+ t.index :is_admin
+ t.index :project_id
+ end
+ end
+end
diff --git a/db/ci/migrate/20150324001123_add_settings_for_shared_runners.rb b/db/ci/migrate/20150324001123_add_settings_for_shared_runners.rb
new file mode 100644
index 00000000000..559ca202134
--- /dev/null
+++ b/db/ci/migrate/20150324001123_add_settings_for_shared_runners.rb
@@ -0,0 +1,6 @@
+class AddSettingsForSharedRunners < ActiveRecord::Migration
+ def change
+ add_column :projects, :shared_runners_enabled, :boolean, default: false
+ add_column :runners, :is_shared, :boolean, default: false
+ end
+end
diff --git a/db/ci/migrate/20150324001227_migrate_shared_runners.rb b/db/ci/migrate/20150324001227_migrate_shared_runners.rb
new file mode 100644
index 00000000000..1d86aa7368c
--- /dev/null
+++ b/db/ci/migrate/20150324001227_migrate_shared_runners.rb
@@ -0,0 +1,11 @@
+class MigrateSharedRunners < ActiveRecord::Migration
+ def up
+ #all shared runners should remain to be shared
+ execute("UPDATE runners SET is_shared = true WHERE id NOT IN (SELECT runner_id FROM runner_projects)");
+
+ Project.update_all(shared_runners_enabled: true)
+ end
+
+ def down
+ end
+end
diff --git a/db/ci/migrate/20150330001111_disable_shared_runners.rb b/db/ci/migrate/20150330001111_disable_shared_runners.rb
new file mode 100644
index 00000000000..dbb32baa27a
--- /dev/null
+++ b/db/ci/migrate/20150330001111_disable_shared_runners.rb
@@ -0,0 +1,8 @@
+class DisableSharedRunners < ActiveRecord::Migration
+ def up
+ execute("UPDATE projects SET shared_runners_enabled = false WHERE id IN (SELECT project_id FROM runner_projects)");
+ end
+
+ def down
+ end
+end
diff --git a/db/ci/migrate/20150415142013_add_deleted_at_to_jobs.rb b/db/ci/migrate/20150415142013_add_deleted_at_to_jobs.rb
new file mode 100644
index 00000000000..7a825a21212
--- /dev/null
+++ b/db/ci/migrate/20150415142013_add_deleted_at_to_jobs.rb
@@ -0,0 +1,6 @@
+class AddDeletedAtToJobs < ActiveRecord::Migration
+ def change
+ add_column :jobs, :deleted_at, :datetime
+ add_index :jobs, :deleted_at
+ end
+end
diff --git a/db/ci/migrate/20150417000045_cleanup_the_build_model.rb b/db/ci/migrate/20150417000045_cleanup_the_build_model.rb
new file mode 100644
index 00000000000..c33470da20e
--- /dev/null
+++ b/db/ci/migrate/20150417000045_cleanup_the_build_model.rb
@@ -0,0 +1,9 @@
+class CleanupTheBuildModel < ActiveRecord::Migration
+ def change
+ remove_column :builds, :push_data, :text
+ remove_column :builds, :before_sha, :string
+ remove_column :builds, :ref, :string
+ remove_column :builds, :sha, :string
+ remove_column :builds, :tmp_file, :string
+ end
+end
diff --git a/db/ci/migrate/20150504010150_migrate_url_to_path.rb b/db/ci/migrate/20150504010150_migrate_url_to_path.rb
new file mode 100644
index 00000000000..31d8c5402fd
--- /dev/null
+++ b/db/ci/migrate/20150504010150_migrate_url_to_path.rb
@@ -0,0 +1,11 @@
+class MigrateUrlToPath < ActiveRecord::Migration
+ def up
+ select_all("SELECT id, gitlab_url FROM projects").each do |project|
+ path = project['gitlab_url'].sub(/.*\/(.*\/.*)$/, '\1')
+ execute("UPDATE projects SET gitlab_url = '#{path}' WHERE id = '#{project['id']}'")
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/ci/migrate/20150504010250_rename_gitlab_url_to_path.rb b/db/ci/migrate/20150504010250_rename_gitlab_url_to_path.rb
new file mode 100644
index 00000000000..6040c320ba5
--- /dev/null
+++ b/db/ci/migrate/20150504010250_rename_gitlab_url_to_path.rb
@@ -0,0 +1,5 @@
+class RenameGitlabUrlToPath < ActiveRecord::Migration
+ def change
+ rename_column :projects, :gitlab_url, :path
+ end
+end
diff --git a/db/ci/migrate/20150508011360_add_info_fields_to_runner.rb b/db/ci/migrate/20150508011360_add_info_fields_to_runner.rb
new file mode 100644
index 00000000000..607d5cc863a
--- /dev/null
+++ b/db/ci/migrate/20150508011360_add_info_fields_to_runner.rb
@@ -0,0 +1,9 @@
+class AddInfoFieldsToRunner < ActiveRecord::Migration
+ def change
+ add_column :runners, :name, :string
+ add_column :runners, :version, :string
+ add_column :runners, :revision, :string
+ add_column :runners, :platform, :string
+ add_column :runners, :architecture, :string
+ end
+end
diff --git a/db/ci/migrate/20150528011001_add_fields_to_builds.rb b/db/ci/migrate/20150528011001_add_fields_to_builds.rb
new file mode 100644
index 00000000000..394dd8bf3dc
--- /dev/null
+++ b/db/ci/migrate/20150528011001_add_fields_to_builds.rb
@@ -0,0 +1,6 @@
+class AddFieldsToBuilds < ActiveRecord::Migration
+ def change
+ add_column :builds, :name, :string
+ add_column :builds, :deploy, :boolean, default: false
+ end
+end
diff --git a/db/ci/migrate/20150528011012_move_job_name_to_build.rb b/db/ci/migrate/20150528011012_move_job_name_to_build.rb
new file mode 100644
index 00000000000..512ad47c5e6
--- /dev/null
+++ b/db/ci/migrate/20150528011012_move_job_name_to_build.rb
@@ -0,0 +1,10 @@
+class MoveJobNameToBuild < ActiveRecord::Migration
+ def up
+ select_all("SELECT id, name FROM jobs").each do |job|
+ execute("UPDATE builds SET name = '#{quote_string(job["name"])}' WHERE job_id = #{job["id"]}")
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/ci/migrate/20150529012113_add_tag_to_commits.rb b/db/ci/migrate/20150529012113_add_tag_to_commits.rb
new file mode 100644
index 00000000000..a8f720730a1
--- /dev/null
+++ b/db/ci/migrate/20150529012113_add_tag_to_commits.rb
@@ -0,0 +1,5 @@
+class AddTagToCommits < ActiveRecord::Migration
+ def change
+ add_column :commits, :tag, :boolean, default: false
+ end
+end
diff --git a/db/ci/migrate/20150601043220_add_yaml_to_projects.rb b/db/ci/migrate/20150601043220_add_yaml_to_projects.rb
new file mode 100644
index 00000000000..f7418426425
--- /dev/null
+++ b/db/ci/migrate/20150601043220_add_yaml_to_projects.rb
@@ -0,0 +1,9 @@
+class AddYamlToProjects < ActiveRecord::Migration
+ def up
+ add_column :projects, :generated_yaml_config, :text
+ end
+
+ def down
+ remove_column :projects, :generated_yaml_config
+ end
+end
diff --git a/db/ci/migrate/20150601043231_migrate_jobs_to_yaml.rb b/db/ci/migrate/20150601043231_migrate_jobs_to_yaml.rb
new file mode 100644
index 00000000000..1fa4cf74dd8
--- /dev/null
+++ b/db/ci/migrate/20150601043231_migrate_jobs_to_yaml.rb
@@ -0,0 +1,97 @@
+# Migration tested on MySQL and PostgreSQL.
+# Can be performed online without errors.
+# This migration will loop through all projects and jobs, so it can take some time.
+
+class MigrateJobsToYaml < ActiveRecord::Migration
+ def up
+ select_all("SELECT * FROM projects").each do |project|
+ config = {}
+
+ concatenate_expression = if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
+ "string_agg(tags.name, ',')"
+ else
+ "GROUP_CONCAT(tags.name SEPARATOR ',')"
+ end
+
+ sql = "SELECT j.*, #{concatenate_expression} tags
+ FROM jobs j
+ LEFT JOIN taggings tgs ON j.id = tgs.taggable_id AND tgs.taggable_type = 'Job'
+ LEFT JOIN tags ON tgs.tag_id = tags.id
+ WHERE project_id = #{project['id']}
+ AND active = true
+ AND job_type = 'parallel'
+ GROUP BY j.id"
+
+ # skip_refs migrate
+ skip_refs = []
+
+ if project["skip_refs"].present?
+ skip_refs = project["skip_refs"].split(",").map(&:strip).select{|ref| ref =~ /^[\w-]*\Z/ }
+ end
+
+
+ # Create Jobs
+ select_all(sql).each do |job|
+ config[job["name"].to_s] = {
+ script: job["commands"] && job["commands"].split("\n").map(&:strip),
+ tags: job["tags"] && job["tags"].split(",").map(&:strip)
+ }
+
+ except = build_except_param(parse_boolean_value(job["build_branches"]), parse_boolean_value(job["build_tags"]))
+ except = except + skip_refs
+
+ if except.any?
+ config[job["name"].to_s][:except] = except
+ end
+ end
+
+ # Create Deploy Jobs
+ select_all(sql.sub("parallel", 'deploy')).each do |job|
+ config[job["name"].to_s] = {
+ script: job["commands"] && job["commands"].split("\n").map(&:strip),
+ type: "deploy",
+ tags: job["tags"] && job["tags"].split(",").map(&:strip)
+ }
+
+ if job["refs"].present?
+ config[job["name"].to_s][:only] = job["refs"].split(",").map(&:strip)
+ else
+ except = build_except_param(parse_boolean_value(job["build_branches"]), parse_boolean_value(job["build_tags"]))
+ except = except + skip_refs
+
+ if except.any?
+ config[job["name"].to_s][:except] = except
+ end
+ end
+ end
+
+ yaml_config = YAML.dump(config.deep_stringify_keys)
+
+ yaml_config.sub!("---", "# This file is generated by GitLab CI")
+
+ execute("UPDATE projects SET generated_yaml_config = '#{quote_string(yaml_config)}' WHERE projects.id = #{project["id"]}")
+ end
+ end
+
+ def down
+
+ end
+
+ private
+
+ def parse_boolean_value(value)
+ [ true, 1, '1', 't', 'T', 'true', 'TRUE', 'on', 'ON' ].include?(value)
+ end
+
+ def build_except_param(branches, tags)
+ unless branches
+ return ["branches"]
+ end
+
+ unless tags
+ return ["tags"]
+ end
+
+ []
+ end
+end
diff --git a/db/ci/migrate/20150602000240_change_default_build_timeout.rb b/db/ci/migrate/20150602000240_change_default_build_timeout.rb
new file mode 100644
index 00000000000..72341699b21
--- /dev/null
+++ b/db/ci/migrate/20150602000240_change_default_build_timeout.rb
@@ -0,0 +1,9 @@
+class ChangeDefaultBuildTimeout < ActiveRecord::Migration
+ def up
+ change_column :projects, :timeout, :integer, default: 3600, null: false
+ end
+
+ def down
+ change_column :projects, :timeout, :integer, default: 1800, null: false
+ end
+end
diff --git a/db/ci/migrate/20150605002131_create_variables.rb b/db/ci/migrate/20150605002131_create_variables.rb
new file mode 100644
index 00000000000..b70b7e28f15
--- /dev/null
+++ b/db/ci/migrate/20150605002131_create_variables.rb
@@ -0,0 +1,11 @@
+class CreateVariables < ActiveRecord::Migration
+ def change
+ create_table :variables do |t|
+ t.integer :project_id, null: false
+ t.string :key
+ t.text :value
+ end
+
+ add_index :variables, :project_id
+ end
+end \ No newline at end of file
diff --git a/db/ci/migrate/20150616001155_add_errors_to_commit.rb b/db/ci/migrate/20150616001155_add_errors_to_commit.rb
new file mode 100644
index 00000000000..fe9f7b954bb
--- /dev/null
+++ b/db/ci/migrate/20150616001155_add_errors_to_commit.rb
@@ -0,0 +1,5 @@
+class AddErrorsToCommit < ActiveRecord::Migration
+ def change
+ add_column :commits, :yaml_errors, :text
+ end
+end \ No newline at end of file
diff --git a/db/ci/migrate/20150630091815_add_options_to_build.rb b/db/ci/migrate/20150630091815_add_options_to_build.rb
new file mode 100644
index 00000000000..68ed3fae756
--- /dev/null
+++ b/db/ci/migrate/20150630091815_add_options_to_build.rb
@@ -0,0 +1,5 @@
+class AddOptionsToBuild < ActiveRecord::Migration
+ def change
+ add_column :builds, :options, :text
+ end
+end
diff --git a/db/ci/migrate/20150703125244_add_encrypted_value_to_variables.rb b/db/ci/migrate/20150703125244_add_encrypted_value_to_variables.rb
new file mode 100644
index 00000000000..0adf31aeb90
--- /dev/null
+++ b/db/ci/migrate/20150703125244_add_encrypted_value_to_variables.rb
@@ -0,0 +1,7 @@
+class AddEncryptedValueToVariables < ActiveRecord::Migration
+ def change
+ add_column :variables, :encrypted_value, :text
+ add_column :variables, :encrypted_value_salt, :string
+ add_column :variables, :encrypted_value_iv, :string
+ end
+end
diff --git a/db/ci/migrate/20150703125325_encrypt_variables.rb b/db/ci/migrate/20150703125325_encrypt_variables.rb
new file mode 100644
index 00000000000..c5f9d048fb1
--- /dev/null
+++ b/db/ci/migrate/20150703125325_encrypt_variables.rb
@@ -0,0 +1,10 @@
+class EncryptVariables < ActiveRecord::Migration
+ def up
+ Variable.find_each do |variable|
+ variable.update(value: variable.read_attribute(:value)) unless variable.encrypted_value
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/ci/migrate/20150707134456_add_allow_failure_to_builds.rb b/db/ci/migrate/20150707134456_add_allow_failure_to_builds.rb
new file mode 100644
index 00000000000..cc3da346e7c
--- /dev/null
+++ b/db/ci/migrate/20150707134456_add_allow_failure_to_builds.rb
@@ -0,0 +1,5 @@
+class AddAllowFailureToBuilds < ActiveRecord::Migration
+ def change
+ add_column :builds, :allow_failure, :boolean, default: false, null: false
+ end
+end
diff --git a/db/ci/migrate/20150710113836_add_job_type_to_builds.rb b/db/ci/migrate/20150710113836_add_job_type_to_builds.rb
new file mode 100644
index 00000000000..2829a0dee23
--- /dev/null
+++ b/db/ci/migrate/20150710113836_add_job_type_to_builds.rb
@@ -0,0 +1,5 @@
+class AddJobTypeToBuilds < ActiveRecord::Migration
+ def change
+ add_column :builds, :job_type, :string
+ end
+end
diff --git a/db/ci/migrate/20150710113851_migrate_deploy_to_job_type_for_builds.rb b/db/ci/migrate/20150710113851_migrate_deploy_to_job_type_for_builds.rb
new file mode 100644
index 00000000000..2690fc1a255
--- /dev/null
+++ b/db/ci/migrate/20150710113851_migrate_deploy_to_job_type_for_builds.rb
@@ -0,0 +1,6 @@
+class MigrateDeployToJobTypeForBuilds < ActiveRecord::Migration
+ def up
+ execute("UPDATE builds SET job_type='test' WHERE NOT deploy")
+ execute("UPDATE builds SET job_type='deploy' WHERE deploy")
+ end
+end
diff --git a/db/ci/migrate/20150721204649_truncate_sessions.rb b/db/ci/migrate/20150721204649_truncate_sessions.rb
new file mode 100644
index 00000000000..32fe6514cbe
--- /dev/null
+++ b/db/ci/migrate/20150721204649_truncate_sessions.rb
@@ -0,0 +1,9 @@
+class TruncateSessions < ActiveRecord::Migration
+ def up
+ execute('DELETE FROM sessions')
+ end
+
+ def down
+ execute('DELETE FROM sessions')
+ end
+end
diff --git a/db/ci/migrate/20150729145246_create_application_settings.rb b/db/ci/migrate/20150729145246_create_application_settings.rb
new file mode 100644
index 00000000000..4623345df9b
--- /dev/null
+++ b/db/ci/migrate/20150729145246_create_application_settings.rb
@@ -0,0 +1,10 @@
+class CreateApplicationSettings < ActiveRecord::Migration
+ def change
+ create_table :application_settings do |t|
+ t.boolean :all_broken_builds
+ t.boolean :add_pusher
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/ci/migrate/20150803142346_rename_job_type_to_stage_builds.rb b/db/ci/migrate/20150803142346_rename_job_type_to_stage_builds.rb
new file mode 100644
index 00000000000..816df0ddf75
--- /dev/null
+++ b/db/ci/migrate/20150803142346_rename_job_type_to_stage_builds.rb
@@ -0,0 +1,9 @@
+class RenameJobTypeToStageBuilds < ActiveRecord::Migration
+ def up
+ rename_column :builds, :job_type, :stage
+ end
+
+ def down
+ rename_column :builds, :stage, :job_type
+ end
+end
diff --git a/db/ci/migrate/20150806091503_add_committed_at_to_commits.rb b/db/ci/migrate/20150806091503_add_committed_at_to_commits.rb
new file mode 100644
index 00000000000..2825b991895
--- /dev/null
+++ b/db/ci/migrate/20150806091503_add_committed_at_to_commits.rb
@@ -0,0 +1,6 @@
+class AddCommittedAtToCommits < ActiveRecord::Migration
+ def up
+ add_column :commits, :committed_at, :timestamp
+ add_index :commits, [:project_id, :committed_at]
+ end
+end
diff --git a/db/ci/migrate/20150806091655_update_committed_at_with_created_at.rb b/db/ci/migrate/20150806091655_update_committed_at_with_created_at.rb
new file mode 100644
index 00000000000..a2646c3dd74
--- /dev/null
+++ b/db/ci/migrate/20150806091655_update_committed_at_with_created_at.rb
@@ -0,0 +1,5 @@
+class UpdateCommittedAtWithCreatedAt < ActiveRecord::Migration
+ def up
+ execute('UPDATE commits SET committed_at=created_at WHERE committed_at IS NULL')
+ end
+end
diff --git a/db/ci/migrate/20150806102222_create_trigger.rb b/db/ci/migrate/20150806102222_create_trigger.rb
new file mode 100644
index 00000000000..0f141b06532
--- /dev/null
+++ b/db/ci/migrate/20150806102222_create_trigger.rb
@@ -0,0 +1,12 @@
+class CreateTrigger < ActiveRecord::Migration
+ def up
+ create_table :triggers do |t|
+ t.string :token, null: true
+ t.integer :project_id, null: false
+ t.datetime :deleted_at
+ t.timestamps
+ end
+
+ add_index :triggers, :deleted_at
+ end
+end
diff --git a/db/ci/migrate/20150806102457_add_trigger_to_builds.rb b/db/ci/migrate/20150806102457_add_trigger_to_builds.rb
new file mode 100644
index 00000000000..ad2fd787228
--- /dev/null
+++ b/db/ci/migrate/20150806102457_add_trigger_to_builds.rb
@@ -0,0 +1,5 @@
+class AddTriggerToBuilds < ActiveRecord::Migration
+ def up
+ add_column :builds, :trigger_request_id, :integer
+ end
+end
diff --git a/db/ci/migrate/20150806105404_create_trigger_request.rb b/db/ci/migrate/20150806105404_create_trigger_request.rb
new file mode 100644
index 00000000000..b58ff31296b
--- /dev/null
+++ b/db/ci/migrate/20150806105404_create_trigger_request.rb
@@ -0,0 +1,9 @@
+class CreateTriggerRequest < ActiveRecord::Migration
+ def change
+ create_table :trigger_requests do |t|
+ t.integer :trigger_id, null: false
+ t.text :variables
+ t.timestamps
+ end
+ end
+end
diff --git a/db/ci/migrate/20150819162227_add_commit_id_to_trigger_requests.rb b/db/ci/migrate/20150819162227_add_commit_id_to_trigger_requests.rb
new file mode 100644
index 00000000000..0e555374f89
--- /dev/null
+++ b/db/ci/migrate/20150819162227_add_commit_id_to_trigger_requests.rb
@@ -0,0 +1,8 @@
+class AddCommitIdToTriggerRequests < ActiveRecord::Migration
+ def up
+ add_column :trigger_requests, :commit_id, :integer
+ end
+
+ def down
+ end
+end
diff --git a/db/ci/schema.rb b/db/ci/schema.rb
new file mode 100644
index 00000000000..2832cd674dd
--- /dev/null
+++ b/db/ci/schema.rb
@@ -0,0 +1,226 @@
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended that you check this file into your version control system.
+
+ActiveRecord::Schema.define(version: 20150819162227) do
+
+ # These are extensions that must be enabled in order to support this database
+ enable_extension "plpgsql"
+
+ create_table "ci_application_settings", force: true do |t|
+ t.boolean "all_broken_builds"
+ t.boolean "add_pusher"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ create_table "ci_builds", force: true do |t|
+ t.integer "project_id"
+ t.string "status"
+ t.datetime "finished_at"
+ t.text "trace"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.datetime "started_at"
+ t.integer "runner_id"
+ t.float "coverage"
+ t.integer "commit_id"
+ t.text "commands"
+ t.integer "job_id"
+ t.string "name"
+ t.boolean "deploy", default: false
+ t.text "options"
+ t.boolean "allow_failure", default: false, null: false
+ t.string "stage"
+ t.integer "trigger_request_id"
+ end
+
+ add_index "ci_builds", ["commit_id"], name: "index_builds_on_commit_id", using: :btree
+ add_index "ci_builds", ["project_id", "commit_id"], name: "index_builds_on_project_id_and_commit_id", using: :btree
+ add_index "ci_builds", ["project_id"], name: "index_builds_on_project_id", using: :btree
+ add_index "ci_builds", ["runner_id"], name: "index_builds_on_runner_id", using: :btree
+
+ create_table "ci_commits", force: true do |t|
+ t.integer "project_id"
+ t.string "ref"
+ t.string "sha"
+ t.string "before_sha"
+ t.text "push_data"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.boolean "tag", default: false
+ t.text "yaml_errors"
+ t.datetime "committed_at"
+ end
+
+ add_index "ci_commits", ["project_id", "committed_at"], name: "index_commits_on_project_id_and_committed_at", using: :btree
+ add_index "ci_commits", ["project_id", "sha"], name: "index_commits_on_project_id_and_sha", using: :btree
+ add_index "ci_commits", ["project_id"], name: "index_commits_on_project_id", using: :btree
+ add_index "ci_commits", ["sha"], name: "index_commits_on_sha", using: :btree
+
+ create_table "ci_events", force: true do |t|
+ t.integer "project_id"
+ t.integer "user_id"
+ t.integer "is_admin"
+ t.text "description"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "ci_events", ["created_at"], name: "index_events_on_created_at", using: :btree
+ add_index "ci_events", ["is_admin"], name: "index_events_on_is_admin", using: :btree
+ add_index "ci_events", ["project_id"], name: "index_events_on_project_id", using: :btree
+
+ create_table "ci_jobs", force: true do |t|
+ t.integer "project_id", null: false
+ t.text "commands"
+ t.boolean "active", default: true, null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "name"
+ t.boolean "build_branches", default: true, null: false
+ t.boolean "build_tags", default: false, null: false
+ t.string "job_type", default: "parallel"
+ t.string "refs"
+ t.datetime "deleted_at"
+ end
+
+ add_index "ci_jobs", ["deleted_at"], name: "index_jobs_on_deleted_at", using: :btree
+ add_index "ci_jobs", ["project_id"], name: "index_jobs_on_project_id", using: :btree
+
+ create_table "ci_projects", force: true do |t|
+ t.string "name", null: false
+ t.integer "timeout", default: 3600, null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "token"
+ t.string "default_ref"
+ t.string "path"
+ t.boolean "always_build", default: false, null: false
+ t.integer "polling_interval"
+ t.boolean "public", default: false, null: false
+ t.string "ssh_url_to_repo"
+ t.integer "gitlab_id"
+ t.boolean "allow_git_fetch", default: true, null: false
+ t.string "email_recipients", default: "", null: false
+ t.boolean "email_add_pusher", default: true, null: false
+ t.boolean "email_only_broken_builds", default: true, null: false
+ t.string "skip_refs"
+ t.string "coverage_regex"
+ t.boolean "shared_runners_enabled", default: false
+ t.text "generated_yaml_config"
+ end
+
+ create_table "ci_runner_projects", force: true do |t|
+ t.integer "runner_id", null: false
+ t.integer "project_id", null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "ci_runner_projects", ["project_id"], name: "index_runner_projects_on_project_id", using: :btree
+ add_index "ci_runner_projects", ["runner_id"], name: "index_runner_projects_on_runner_id", using: :btree
+
+ create_table "ci_runners", force: true do |t|
+ t.string "token"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "description"
+ t.datetime "contacted_at"
+ t.boolean "active", default: true, null: false
+ t.boolean "is_shared", default: false
+ t.string "name"
+ t.string "version"
+ t.string "revision"
+ t.string "platform"
+ t.string "architecture"
+ end
+
+ create_table "ci_services", force: true do |t|
+ t.string "type"
+ t.string "title"
+ t.integer "project_id", null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.boolean "active", default: false, null: false
+ t.text "properties"
+ end
+
+ add_index "ci_services", ["project_id"], name: "index_services_on_project_id", using: :btree
+
+ create_table "ci_sessions", force: true do |t|
+ t.string "session_id", null: false
+ t.text "data"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "ci_sessions", ["session_id"], name: "index_sessions_on_session_id", using: :btree
+ add_index "ci_sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree
+
+ create_table "ci_taggings", force: true do |t|
+ t.integer "tag_id"
+ t.integer "taggable_id"
+ t.string "taggable_type"
+ t.integer "tagger_id"
+ t.string "tagger_type"
+ t.string "context", limit: 128
+ t.datetime "created_at"
+ end
+
+ add_index "ci_taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true, using: :btree
+ add_index "ci_taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree
+
+ create_table "ci_tags", force: true do |t|
+ t.string "name"
+ t.integer "taggings_count", default: 0
+ end
+
+ add_index "ci_tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree
+
+ create_table "ci_trigger_requests", force: true do |t|
+ t.integer "trigger_id", null: false
+ t.text "variables"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "commit_id"
+ end
+
+ create_table "ci_triggers", force: true do |t|
+ t.string "token"
+ t.integer "project_id", null: false
+ t.datetime "deleted_at"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "ci_triggers", ["deleted_at"], name: "index_triggers_on_deleted_at", using: :btree
+
+ create_table "ci_variables", force: true do |t|
+ t.integer "project_id", null: false
+ t.string "key"
+ t.text "value"
+ t.text "encrypted_value"
+ t.string "encrypted_value_salt"
+ t.string "encrypted_value_iv"
+ end
+
+ add_index "ci_variables", ["project_id"], name: "index_variables_on_project_id", using: :btree
+
+ create_table "ci_web_hooks", force: true do |t|
+ t.string "url", null: false
+ t.integer "project_id", null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+end
diff --git a/db/ci/seeds.rb b/db/ci/seeds.rb
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/db/ci/seeds.rb
diff --git a/db/migrate/20150826001931_add_ci_tables.rb b/db/migrate/20150826001931_add_ci_tables.rb
new file mode 100644
index 00000000000..c4f51363e57
--- /dev/null
+++ b/db/migrate/20150826001931_add_ci_tables.rb
@@ -0,0 +1,190 @@
+class AddCiTables < ActiveRecord::Migration
+ def change
+ create_table "ci_application_settings", force: true do |t|
+ t.boolean "all_broken_builds"
+ t.boolean "add_pusher"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ create_table "ci_builds", force: true do |t|
+ t.integer "project_id"
+ t.string "status"
+ t.datetime "finished_at"
+ t.text "trace"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.datetime "started_at"
+ t.integer "runner_id"
+ t.float "coverage"
+ t.integer "commit_id"
+ t.text "commands"
+ t.integer "job_id"
+ t.string "name"
+ t.boolean "deploy", default: false
+ t.text "options"
+ t.boolean "allow_failure", default: false, null: false
+ t.string "stage"
+ t.integer "trigger_request_id"
+ end
+
+ add_index "ci_builds", ["commit_id"], name: "index_ci_builds_on_commit_id", using: :btree
+ add_index "ci_builds", ["project_id", "commit_id"], name: "index_ci_builds_on_project_id_and_commit_id", using: :btree
+ add_index "ci_builds", ["project_id"], name: "index_ci_builds_on_project_id", using: :btree
+ add_index "ci_builds", ["runner_id"], name: "index_ci_builds_on_runner_id", using: :btree
+
+ create_table "ci_commits", force: true do |t|
+ t.integer "project_id"
+ t.string "ref"
+ t.string "sha"
+ t.string "before_sha"
+ t.text "push_data"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.boolean "tag", default: false
+ t.text "yaml_errors"
+ t.datetime "committed_at"
+ end
+
+ add_index "ci_commits", ["project_id", "committed_at"], name: "index_ci_commits_on_project_id_and_committed_at", using: :btree
+ add_index "ci_commits", ["project_id", "sha"], name: "index_ci_commits_on_project_id_and_sha", using: :btree
+ add_index "ci_commits", ["project_id"], name: "index_ci_commits_on_project_id", using: :btree
+ add_index "ci_commits", ["sha"], name: "index_ci_commits_on_sha", using: :btree
+
+ create_table "ci_events", force: true do |t|
+ t.integer "project_id"
+ t.integer "user_id"
+ t.integer "is_admin"
+ t.text "description"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "ci_events", ["created_at"], name: "index_ci_events_on_created_at", using: :btree
+ add_index "ci_events", ["is_admin"], name: "index_ci_events_on_is_admin", using: :btree
+ add_index "ci_events", ["project_id"], name: "index_ci_events_on_project_id", using: :btree
+
+ create_table "ci_jobs", force: true do |t|
+ t.integer "project_id", null: false
+ t.text "commands"
+ t.boolean "active", default: true, null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "name"
+ t.boolean "build_branches", default: true, null: false
+ t.boolean "build_tags", default: false, null: false
+ t.string "job_type", default: "parallel"
+ t.string "refs"
+ t.datetime "deleted_at"
+ end
+
+ add_index "ci_jobs", ["deleted_at"], name: "index_ci_jobs_on_deleted_at", using: :btree
+ add_index "ci_jobs", ["project_id"], name: "index_ci_jobs_on_project_id", using: :btree
+
+ create_table "ci_projects", force: true do |t|
+ t.string "name", null: false
+ t.integer "timeout", default: 3600, null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "token"
+ t.string "default_ref"
+ t.string "path"
+ t.boolean "always_build", default: false, null: false
+ t.integer "polling_interval"
+ t.boolean "public", default: false, null: false
+ t.string "ssh_url_to_repo"
+ t.integer "gitlab_id"
+ t.boolean "allow_git_fetch", default: true, null: false
+ t.string "email_recipients", default: "", null: false
+ t.boolean "email_add_pusher", default: true, null: false
+ t.boolean "email_only_broken_builds", default: true, null: false
+ t.string "skip_refs"
+ t.string "coverage_regex"
+ t.boolean "shared_runners_enabled", default: false
+ t.text "generated_yaml_config"
+ end
+
+ create_table "ci_runner_projects", force: true do |t|
+ t.integer "runner_id", null: false
+ t.integer "project_id", null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "ci_runner_projects", ["project_id"], name: "index_ci_runner_projects_on_project_id", using: :btree
+ add_index "ci_runner_projects", ["runner_id"], name: "index_ci_runner_projects_on_runner_id", using: :btree
+
+ create_table "ci_runners", force: true do |t|
+ t.string "token"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "description"
+ t.datetime "contacted_at"
+ t.boolean "active", default: true, null: false
+ t.boolean "is_shared", default: false
+ t.string "name"
+ t.string "version"
+ t.string "revision"
+ t.string "platform"
+ t.string "architecture"
+ end
+
+ create_table "ci_services", force: true do |t|
+ t.string "type"
+ t.string "title"
+ t.integer "project_id", null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.boolean "active", default: false, null: false
+ t.text "properties"
+ end
+
+ add_index "ci_services", ["project_id"], name: "index_ci_services_on_project_id", using: :btree
+
+ create_table "ci_sessions", force: true do |t|
+ t.string "session_id", null: false
+ t.text "data"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "ci_sessions", ["session_id"], name: "index_ci_sessions_on_session_id", using: :btree
+ add_index "ci_sessions", ["updated_at"], name: "index_ci_sessions_on_updated_at", using: :btree
+
+ create_table "ci_trigger_requests", force: true do |t|
+ t.integer "trigger_id", null: false
+ t.text "variables"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "commit_id"
+ end
+
+ create_table "ci_triggers", force: true do |t|
+ t.string "token"
+ t.integer "project_id", null: false
+ t.datetime "deleted_at"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "ci_triggers", ["deleted_at"], name: "index_ci_triggers_on_deleted_at", using: :btree
+
+ create_table "ci_variables", force: true do |t|
+ t.integer "project_id", null: false
+ t.string "key"
+ t.text "value"
+ t.text "encrypted_value"
+ t.string "encrypted_value_salt"
+ t.string "encrypted_value_iv"
+ end
+
+ add_index "ci_variables", ["project_id"], name: "index_ci_variables_on_project_id", using: :btree
+
+ create_table "ci_web_hooks", force: true do |t|
+ t.string "url", null: false
+ t.integer "project_id", null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+ end
+end
diff --git a/db/migrate/limits_to_mysql.rb b/db/migrate/limits_to_mysql.rb
index 2b7afae6d7c..60e65914f48 100644
--- a/db/migrate/limits_to_mysql.rb
+++ b/db/migrate/limits_to_mysql.rb
@@ -6,5 +6,9 @@ class LimitsToMysql < ActiveRecord::Migration
change_column :merge_request_diffs, :st_diffs, :text, limit: 2147483647
change_column :snippets, :content, :text, limit: 2147483647
change_column :notes, :st_diff, :text, limit: 2147483647
+
+ # CI
+ change_column :builds, :trace, :text, limit: 1073741823
+ change_column :commits, :push_data, :text, limit: 16777215
end
end
diff --git a/db/schema.rb b/db/schema.rb
index 108c48bf321..585531c1ee6 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20150818213832) do
+ActiveRecord::Schema.define(version: 20150826001931) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -24,6 +24,17 @@ ActiveRecord::Schema.define(version: 20150818213832) do
t.datetime "updated_at"
end
+ create_table "appearances", force: true do |t|
+ t.string "title"
+ t.text "description"
+ t.string "logo"
+ t.integer "updated_by"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "dark_logo"
+ t.string "light_logo"
+ end
+
create_table "application_settings", force: true do |t|
t.integer "default_projects_limit"
t.boolean "signup_enabled"
@@ -35,10 +46,11 @@ ActiveRecord::Schema.define(version: 20150818213832) do
t.string "home_page_url"
t.integer "default_branch_protection", default: 2
t.boolean "twitter_sharing_enabled", default: true
+ t.text "help_text"
t.text "restricted_visibility_levels"
- t.boolean "version_check_enabled", default: true
t.integer "max_attachment_size", default: 10, null: false
t.integer "default_project_visibility"
+ t.boolean "version_check_enabled", default: true
t.integer "default_snippet_visibility"
t.text "restricted_signup_domains"
t.boolean "user_oauth_applications", default: true
@@ -72,6 +84,193 @@ ActiveRecord::Schema.define(version: 20150818213832) do
t.string "font"
end
+ create_table "ci_application_settings", force: true do |t|
+ t.boolean "all_broken_builds"
+ t.boolean "add_pusher"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ create_table "ci_builds", force: true do |t|
+ t.integer "project_id"
+ t.string "status"
+ t.datetime "finished_at"
+ t.text "trace"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.datetime "started_at"
+ t.integer "runner_id"
+ t.float "coverage"
+ t.integer "commit_id"
+ t.text "commands"
+ t.integer "job_id"
+ t.string "name"
+ t.boolean "deploy", default: false
+ t.text "options"
+ t.boolean "allow_failure", default: false, null: false
+ t.string "stage"
+ t.integer "trigger_request_id"
+ end
+
+ add_index "ci_builds", ["commit_id"], name: "index_ci_builds_on_commit_id", using: :btree
+ add_index "ci_builds", ["project_id", "commit_id"], name: "index_ci_builds_on_project_id_and_commit_id", using: :btree
+ add_index "ci_builds", ["project_id"], name: "index_ci_builds_on_project_id", using: :btree
+ add_index "ci_builds", ["runner_id"], name: "index_ci_builds_on_runner_id", using: :btree
+
+ create_table "ci_commits", force: true do |t|
+ t.integer "project_id"
+ t.string "ref"
+ t.string "sha"
+ t.string "before_sha"
+ t.text "push_data"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.boolean "tag", default: false
+ t.text "yaml_errors"
+ t.datetime "committed_at"
+ end
+
+ add_index "ci_commits", ["project_id", "committed_at"], name: "index_ci_commits_on_project_id_and_committed_at", using: :btree
+ add_index "ci_commits", ["project_id", "sha"], name: "index_ci_commits_on_project_id_and_sha", using: :btree
+ add_index "ci_commits", ["project_id"], name: "index_ci_commits_on_project_id", using: :btree
+ add_index "ci_commits", ["sha"], name: "index_ci_commits_on_sha", using: :btree
+
+ create_table "ci_events", force: true do |t|
+ t.integer "project_id"
+ t.integer "user_id"
+ t.integer "is_admin"
+ t.text "description"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "ci_events", ["created_at"], name: "index_ci_events_on_created_at", using: :btree
+ add_index "ci_events", ["is_admin"], name: "index_ci_events_on_is_admin", using: :btree
+ add_index "ci_events", ["project_id"], name: "index_ci_events_on_project_id", using: :btree
+
+ create_table "ci_jobs", force: true do |t|
+ t.integer "project_id", null: false
+ t.text "commands"
+ t.boolean "active", default: true, null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "name"
+ t.boolean "build_branches", default: true, null: false
+ t.boolean "build_tags", default: false, null: false
+ t.string "job_type", default: "parallel"
+ t.string "refs"
+ t.datetime "deleted_at"
+ end
+
+ add_index "ci_jobs", ["deleted_at"], name: "index_ci_jobs_on_deleted_at", using: :btree
+ add_index "ci_jobs", ["project_id"], name: "index_ci_jobs_on_project_id", using: :btree
+
+ create_table "ci_projects", force: true do |t|
+ t.string "name", null: false
+ t.integer "timeout", default: 3600, null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "token"
+ t.string "default_ref"
+ t.string "path"
+ t.boolean "always_build", default: false, null: false
+ t.integer "polling_interval"
+ t.boolean "public", default: false, null: false
+ t.string "ssh_url_to_repo"
+ t.integer "gitlab_id"
+ t.boolean "allow_git_fetch", default: true, null: false
+ t.string "email_recipients", default: "", null: false
+ t.boolean "email_add_pusher", default: true, null: false
+ t.boolean "email_only_broken_builds", default: true, null: false
+ t.string "skip_refs"
+ t.string "coverage_regex"
+ t.boolean "shared_runners_enabled", default: false
+ t.text "generated_yaml_config"
+ end
+
+ create_table "ci_runner_projects", force: true do |t|
+ t.integer "runner_id", null: false
+ t.integer "project_id", null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "ci_runner_projects", ["project_id"], name: "index_ci_runner_projects_on_project_id", using: :btree
+ add_index "ci_runner_projects", ["runner_id"], name: "index_ci_runner_projects_on_runner_id", using: :btree
+
+ create_table "ci_runners", force: true do |t|
+ t.string "token"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "description"
+ t.datetime "contacted_at"
+ t.boolean "active", default: true, null: false
+ t.boolean "is_shared", default: false
+ t.string "name"
+ t.string "version"
+ t.string "revision"
+ t.string "platform"
+ t.string "architecture"
+ end
+
+ create_table "ci_services", force: true do |t|
+ t.string "type"
+ t.string "title"
+ t.integer "project_id", null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.boolean "active", default: false, null: false
+ t.text "properties"
+ end
+
+ add_index "ci_services", ["project_id"], name: "index_ci_services_on_project_id", using: :btree
+
+ create_table "ci_sessions", force: true do |t|
+ t.string "session_id", null: false
+ t.text "data"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "ci_sessions", ["session_id"], name: "index_ci_sessions_on_session_id", using: :btree
+ add_index "ci_sessions", ["updated_at"], name: "index_ci_sessions_on_updated_at", using: :btree
+
+ create_table "ci_trigger_requests", force: true do |t|
+ t.integer "trigger_id", null: false
+ t.text "variables"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "commit_id"
+ end
+
+ create_table "ci_triggers", force: true do |t|
+ t.string "token"
+ t.integer "project_id", null: false
+ t.datetime "deleted_at"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "ci_triggers", ["deleted_at"], name: "index_ci_triggers_on_deleted_at", using: :btree
+
+ create_table "ci_variables", force: true do |t|
+ t.integer "project_id", null: false
+ t.string "key"
+ t.text "value"
+ t.text "encrypted_value"
+ t.string "encrypted_value_salt"
+ t.string "encrypted_value_iv"
+ end
+
+ add_index "ci_variables", ["project_id"], name: "index_ci_variables_on_project_id", using: :btree
+
+ create_table "ci_web_hooks", force: true do |t|
+ t.string "url", null: false
+ t.integer "project_id", null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
create_table "deploy_keys_projects", force: true do |t|
t.integer "deploy_key_id", null: false
t.integer "project_id", null: false
@@ -119,6 +318,28 @@ ActiveRecord::Schema.define(version: 20150818213832) do
add_index "forked_project_links", ["forked_to_project_id"], name: "index_forked_project_links_on_forked_to_project_id", unique: true, using: :btree
+ create_table "git_hooks", force: true do |t|
+ t.string "force_push_regex"
+ t.string "delete_branch_regex"
+ t.string "commit_message_regex"
+ t.boolean "deny_delete_tag"
+ t.integer "project_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "author_email_regex"
+ t.boolean "member_check", default: false, null: false
+ t.string "file_name_regex"
+ t.boolean "is_sample", default: false
+ t.integer "max_file_size", default: 0
+ end
+
+ create_table "historical_data", force: true do |t|
+ t.date "date", null: false
+ t.integer "active_user_count"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
create_table "identities", force: true do |t|
t.string "extern_uid"
t.string "provider"
@@ -190,6 +411,21 @@ ActiveRecord::Schema.define(version: 20150818213832) do
add_index "labels", ["project_id"], name: "index_labels_on_project_id", using: :btree
+ create_table "ldap_group_links", force: true do |t|
+ t.string "cn", null: false
+ t.integer "group_access", null: false
+ t.integer "group_id", null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "provider"
+ end
+
+ create_table "licenses", force: true do |t|
+ t.text "data", null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
create_table "members", force: true do |t|
t.integer "access_level", null: false
t.integer "source_id", null: false
@@ -271,18 +507,19 @@ ActiveRecord::Schema.define(version: 20150818213832) do
add_index "milestones", ["project_id"], name: "index_milestones_on_project_id", using: :btree
create_table "namespaces", force: true do |t|
- t.string "name", null: false
- t.string "path", null: false
+ t.string "name", null: false
+ t.string "path", null: false
t.integer "owner_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "type"
- t.string "description", default: "", null: false
+ t.string "description", default: "", null: false
t.string "avatar"
+ t.boolean "membership_lock", default: false
end
add_index "namespaces", ["created_at", "id"], name: "index_namespaces_on_created_at_and_id", using: :btree
- add_index "namespaces", ["name"], name: "index_namespaces_on_name", unique: true, using: :btree
+ add_index "namespaces", ["name"], name: "index_namespaces_on_name", using: :btree
add_index "namespaces", ["owner_id"], name: "index_namespaces_on_owner_id", using: :btree
add_index "namespaces", ["path"], name: "index_namespaces_on_path", unique: true, using: :btree
add_index "namespaces", ["type"], name: "index_namespaces_on_type", using: :btree
@@ -356,6 +593,14 @@ ActiveRecord::Schema.define(version: 20150818213832) do
add_index "oauth_applications", ["owner_id", "owner_type"], name: "index_oauth_applications_on_owner_id_and_owner_type", using: :btree
add_index "oauth_applications", ["uid"], name: "index_oauth_applications_on_uid", unique: true, using: :btree
+ create_table "project_group_links", force: true do |t|
+ t.integer "project_id", null: false
+ t.integer "group_id", null: false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "group_access", default: 30, null: false
+ end
+
create_table "project_import_data", force: true do |t|
t.integer "project_id"
t.text "data"
@@ -368,25 +613,28 @@ ActiveRecord::Schema.define(version: 20150818213832) do
t.datetime "created_at"
t.datetime "updated_at"
t.integer "creator_id"
- t.boolean "issues_enabled", default: true, null: false
- t.boolean "wall_enabled", default: true, null: false
- t.boolean "merge_requests_enabled", default: true, null: false
- t.boolean "wiki_enabled", default: true, null: false
+ t.boolean "issues_enabled", default: true, null: false
+ t.boolean "wall_enabled", default: true, null: false
+ t.boolean "merge_requests_enabled", default: true, null: false
+ t.boolean "wiki_enabled", default: true, null: false
t.integer "namespace_id"
- t.string "issues_tracker", default: "gitlab", null: false
+ t.string "issues_tracker", default: "gitlab", null: false
t.string "issues_tracker_id"
- t.boolean "snippets_enabled", default: true, null: false
+ t.boolean "snippets_enabled", default: true, null: false
t.datetime "last_activity_at"
t.string "import_url"
- t.integer "visibility_level", default: 0, null: false
- t.boolean "archived", default: false, null: false
+ t.integer "visibility_level", default: 0, null: false
+ t.boolean "archived", default: false, null: false
t.string "avatar"
t.string "import_status"
- t.float "repository_size", default: 0.0
- t.integer "star_count", default: 0, null: false
+ t.float "repository_size", default: 0.0
+ t.integer "star_count", default: 0, null: false
t.string "import_type"
t.string "import_source"
- t.integer "commit_count", default: 0
+ t.text "merge_requests_template"
+ t.boolean "merge_requests_rebase_enabled", default: false
+ t.boolean "merge_requests_rebase_default", default: true
+ t.integer "commit_count", default: 0
end
add_index "projects", ["created_at", "id"], name: "index_projects_on_created_at_and_id", using: :btree
@@ -486,13 +734,19 @@ ActiveRecord::Schema.define(version: 20150818213832) do
add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree
+ create_table "test", id: false, force: true do |t|
+ t.integer "col"
+ end
+
+ add_index "test", ["col"], name: "index_name", unique: true, using: :btree
+
create_table "users", force: true do |t|
- t.string "email", default: "", null: false
- t.string "encrypted_password", default: "", null: false
+ t.string "email", default: "", null: false
+ t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
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"
@@ -500,22 +754,22 @@ ActiveRecord::Schema.define(version: 20150818213832) do
t.datetime "created_at"
t.datetime "updated_at"
t.string "name"
- t.boolean "admin", default: false, null: false
- t.integer "projects_limit", default: 10
- t.string "skype", default: "", null: false
- t.string "linkedin", default: "", null: false
- t.string "twitter", default: "", null: false
+ t.boolean "admin", default: false, null: false
+ t.integer "projects_limit", default: 10
+ t.string "skype", default: "", null: false
+ t.string "linkedin", default: "", null: false
+ t.string "twitter", default: "", null: false
t.string "authentication_token"
- t.integer "theme_id", default: 1, null: false
+ t.integer "theme_id", default: 1, null: false
t.string "bio"
- t.integer "failed_attempts", default: 0
+ t.integer "failed_attempts", default: 0
t.datetime "locked_at"
t.string "username"
- t.boolean "can_create_group", default: true, null: false
- t.boolean "can_create_team", default: true, null: false
+ t.boolean "can_create_group", default: true, null: false
+ t.boolean "can_create_team", default: true, null: false
t.string "state"
- t.integer "color_scheme_id", default: 1, null: false
- t.integer "notification_level", default: 1, null: false
+ t.integer "color_scheme_id", default: 1, null: false
+ t.integer "notification_level", default: 1, null: false
t.datetime "password_expires_at"
t.integer "created_by_id"
t.datetime "last_credential_check_at"
@@ -524,20 +778,21 @@ ActiveRecord::Schema.define(version: 20150818213832) do
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "unconfirmed_email"
- t.boolean "hide_no_ssh_key", default: false
- t.string "website_url", default: "", null: false
+ t.boolean "hide_no_ssh_key", default: false
+ t.string "website_url", default: "", null: false
t.string "notification_email"
- t.boolean "hide_no_password", default: false
- t.boolean "password_automatically_set", default: false
+ t.boolean "hide_no_password", default: false
+ t.boolean "password_automatically_set", default: false
+ t.datetime "admin_email_unsubscribed_at"
t.string "location"
+ t.string "public_email", default: "", null: false
t.string "encrypted_otp_secret"
t.string "encrypted_otp_secret_iv"
t.string "encrypted_otp_secret_salt"
- t.boolean "otp_required_for_login", default: false, null: false
+ t.boolean "otp_required_for_login", default: false, null: false
t.text "otp_backup_codes"
- t.string "public_email", default: "", null: false
- t.integer "dashboard", default: 0
- t.integer "project_view", default: 0
+ t.integer "dashboard", default: 0
+ t.integer "project_view", default: 0
end
add_index "users", ["admin"], name: "index_users_on_admin", using: :btree
@@ -572,6 +827,7 @@ ActiveRecord::Schema.define(version: 20150818213832) do
t.boolean "issues_events", default: false, null: false
t.boolean "merge_requests_events", default: false, null: false
t.boolean "tag_push_events", default: false
+ t.integer "group_id"
t.boolean "note_events", default: false, null: false
end