diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/fixtures/development/14_pipelines.rb | 5 | ||||
-rw-r--r-- | db/migrate/20181119132520_add_indexes_to_ci_builds_and_pipelines.rb | 2 | ||||
-rw-r--r-- | db/migrate/20181212171634_create_error_tracking_settings.rb | 17 | ||||
-rw-r--r-- | db/migrate/20181219145521_add_options_to_build_metadata.rb | 15 | ||||
-rw-r--r-- | db/schema.rb | 10 |
5 files changed, 46 insertions, 3 deletions
diff --git a/db/fixtures/development/14_pipelines.rb b/db/fixtures/development/14_pipelines.rb index bdc0a2db7db..db043e39d2c 100644 --- a/db/fixtures/development/14_pipelines.rb +++ b/db/fixtures/development/14_pipelines.rb @@ -102,14 +102,15 @@ class Gitlab::Seeder::Pipelines [] end - def create_pipeline!(project, ref, commit) project.ci_pipelines.create!(sha: commit.id, ref: ref, source: :push) end def build_create!(pipeline, opts = {}) attributes = job_attributes(pipeline, opts) - .merge(commands: '$ build command') + + attributes[:options] ||= {} + attributes[:options][:script] = 'build command' Ci::Build.create!(attributes).tap do |build| # We need to set build trace and artifacts after saving a build diff --git a/db/migrate/20181119132520_add_indexes_to_ci_builds_and_pipelines.rb b/db/migrate/20181119132520_add_indexes_to_ci_builds_and_pipelines.rb index adbc3928b26..cb01fa113eb 100644 --- a/db/migrate/20181119132520_add_indexes_to_ci_builds_and_pipelines.rb +++ b/db/migrate/20181119132520_add_indexes_to_ci_builds_and_pipelines.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class AddIndexesToCiBuildsAndPipelines < ActiveRecord::Migration +class AddIndexesToCiBuildsAndPipelines < ActiveRecord::Migration[5.0] include Gitlab::Database::MigrationHelpers DOWNTIME = false diff --git a/db/migrate/20181212171634_create_error_tracking_settings.rb b/db/migrate/20181212171634_create_error_tracking_settings.rb new file mode 100644 index 00000000000..18c38bd2c47 --- /dev/null +++ b/db/migrate/20181212171634_create_error_tracking_settings.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CreateErrorTrackingSettings < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + create_table :project_error_tracking_settings, id: :int, primary_key: :project_id, default: nil do |t| + t.boolean :enabled, null: false, default: true + t.string :api_url, null: false + t.string :encrypted_token + t.string :encrypted_token_iv + t.foreign_key :projects, column: :project_id, on_delete: :cascade + end + end +end diff --git a/db/migrate/20181219145521_add_options_to_build_metadata.rb b/db/migrate/20181219145521_add_options_to_build_metadata.rb new file mode 100644 index 00000000000..dc9569babc2 --- /dev/null +++ b/db/migrate/20181219145521_add_options_to_build_metadata.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddOptionsToBuildMetadata < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + add_column :ci_builds_metadata, :config_options, :jsonb + add_column :ci_builds_metadata, :config_variables, :jsonb + end +end diff --git a/db/schema.rb b/db/schema.rb index 97daf8ee617..87826881d58 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -374,6 +374,8 @@ ActiveRecord::Schema.define(version: 20190103140724) do t.integer "project_id", null: false t.integer "timeout" t.integer "timeout_source", default: 1, null: false + t.jsonb "config_options" + t.jsonb "config_variables" t.index ["build_id"], name: "index_ci_builds_metadata_on_build_id", unique: true, using: :btree t.index ["project_id"], name: "index_ci_builds_metadata_on_project_id", using: :btree end @@ -1571,6 +1573,13 @@ ActiveRecord::Schema.define(version: 20190103140724) do t.index ["project_id", "deploy_token_id"], name: "index_project_deploy_tokens_on_project_id_and_deploy_token_id", unique: true, using: :btree end + create_table "project_error_tracking_settings", primary_key: "project_id", id: :integer, force: :cascade do |t| + t.boolean "enabled", default: true, null: false + t.string "api_url", null: false + t.string "encrypted_token" + t.string "encrypted_token_iv" + end + create_table "project_features", force: :cascade do |t| t.integer "project_id", null: false t.integer "merge_requests_access_level" @@ -2432,6 +2441,7 @@ ActiveRecord::Schema.define(version: 20190103140724) do add_foreign_key "project_custom_attributes", "projects", on_delete: :cascade add_foreign_key "project_deploy_tokens", "deploy_tokens", on_delete: :cascade add_foreign_key "project_deploy_tokens", "projects", on_delete: :cascade + add_foreign_key "project_error_tracking_settings", "projects", on_delete: :cascade add_foreign_key "project_features", "projects", name: "fk_18513d9b92", on_delete: :cascade add_foreign_key "project_group_links", "projects", name: "fk_daa8cee94c", on_delete: :cascade add_foreign_key "project_import_data", "projects", name: "fk_ffb9ee3a10", on_delete: :cascade |