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

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

class CreateDailyReportResults < ActiveRecord::Migration[6.0]
  DOWNTIME = false

  def change
    create_table :ci_daily_report_results do |t|
      t.date :date, null: false
      t.bigint :project_id, null: false
      t.bigint :last_pipeline_id, null: false
      t.float :value, null: false
      t.integer :param_type, limit: 8, null: false
      t.string :ref_path, null: false # rubocop:disable Migration/AddLimitToStringColumns
      t.string :title, null: false # rubocop:disable Migration/AddLimitToStringColumns

      t.index :last_pipeline_id
      t.index [:project_id, :ref_path, :param_type, :date, :title], name: 'index_daily_report_results_unique_columns', unique: true
      t.foreign_key :projects, on_delete: :cascade
      t.foreign_key :ci_pipelines, column: :last_pipeline_id, on_delete: :cascade
    end
  end
end