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

20220923103006_add_ci_pipeline_metadata_title.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3b2f02924a1766e271b9edc84868fb2caa30ee82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

class AddCiPipelineMetadataTitle < Gitlab::Database::Migration[2.0]
  enable_lock_retries!

  def up
    create_table :ci_pipeline_metadata, id: false do |t|
      t.bigint :project_id, null: false

      t.references :pipeline,
                   null: false,
                   primary_key: true,
                   default: nil,
                   index: false,
                   foreign_key: { to_table: :ci_pipelines, on_delete: :cascade }

      t.text :title, null: false, limit: 255

      t.index [:pipeline_id, :title], name: 'index_ci_pipeline_metadata_on_pipeline_id_title'
      t.index [:project_id], name: 'index_ci_pipeline_metadata_on_project_id'
    end
  end

  def down
    drop_table :ci_pipeline_metadata
  end
end