Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20171006090100_create_ci_build_trace_section_names.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 88f3e60699ae7557523c7ca0d14bfb830a662fd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class CreateCiBuildTraceSectionNames < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  def up
    create_table :ci_build_trace_section_names do |t|
      t.references :project, null: false, foreign_key: { on_delete: :cascade }
      t.string :name, null: false
    end

    add_index :ci_build_trace_section_names, [:project_id, :name], unique: true
  end

  def down
    remove_foreign_key :ci_build_trace_section_names, column: :project_id
    drop_table :ci_build_trace_section_names
  end
end