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

20230607101334_add_ci_job_annotations_table.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: caf7fb6fb3356191c1d2a72125b78c87f9b3f7e6 (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 AddCiJobAnnotationsTable < Gitlab::Database::Migration[2.1]
  enable_lock_retries!

  def change
    options = {
      primary_key: [:id, :partition_id],
      options: 'PARTITION BY LIST (partition_id)',
      if_not_exists: true
    }

    create_table(:p_ci_job_annotations, **options) do |t|
      t.bigserial :id, null: false
      t.bigint :partition_id, null: false
      t.bigint :job_id, null: false
      t.text :name, null: false, limit: 255
      t.jsonb :data, default: [], null: false
    end
  end
end