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

20220324180717_remove_project_pages_metadata_artifacts_archive_id_column.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 287752b6b5cd1f2da454ffe2027265a627bcb48d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

class RemoveProjectPagesMetadataArtifactsArchiveIdColumn < Gitlab::Database::Migration[1.0]
  disable_ddl_transaction!

  def up
    remove_column :project_pages_metadata, :artifacts_archive_id
  end

  def down
    unless column_exists?(:project_pages_metadata, :artifacts_archive_id)
      add_column :project_pages_metadata, :artifacts_archive_id, :bigint
    end

    add_concurrent_index(
      :project_pages_metadata,
      :artifacts_archive_id,
      name: "index_project_pages_metadata_on_artifacts_archive_id"
    )
  end
end