2020-03-18 05:09:31 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class CreateDailyReportResults < ActiveRecord::Migration[6.0]
|
|
|
|
DOWNTIME = false
|
|
|
|
|
2020-04-21 11:21:10 -04:00
|
|
|
# rubocop:disable Migration/PreventStrings
|
2020-03-18 05:09:31 -04:00
|
|
|
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
|
2020-04-21 11:21:10 -04:00
|
|
|
t.string :ref_path, null: false
|
|
|
|
t.string :title, null: false
|
2020-03-18 05:09:31 -04:00
|
|
|
|
|
|
|
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
|
2020-04-21 11:21:10 -04:00
|
|
|
# rubocop:enable Migration/PreventStrings
|
2020-03-18 05:09:31 -04:00
|
|
|
end
|