summaryrefslogtreecommitdiff
path: root/db/migrate/20220511090324_add_last_consistency_check_cursors_to_vsa_aggregations.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20220511090324_add_last_consistency_check_cursors_to_vsa_aggregations.rb')
-rw-r--r--db/migrate/20220511090324_add_last_consistency_check_cursors_to_vsa_aggregations.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/db/migrate/20220511090324_add_last_consistency_check_cursors_to_vsa_aggregations.rb b/db/migrate/20220511090324_add_last_consistency_check_cursors_to_vsa_aggregations.rb
new file mode 100644
index 00000000000..53c09597be5
--- /dev/null
+++ b/db/migrate/20220511090324_add_last_consistency_check_cursors_to_vsa_aggregations.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class AddLastConsistencyCheckCursorsToVsaAggregations < Gitlab::Database::Migration[2.0]
+ def up
+ change_table(:analytics_cycle_analytics_aggregations, bulk: true) do |t|
+ t.column :last_consistency_check_issues_stage_event_hash_id, :bigint, null: true
+ t.column :last_consistency_check_issues_start_event_timestamp, :datetime_with_timezone, null: true
+ t.column :last_consistency_check_issues_end_event_timestamp, :datetime_with_timezone, null: true
+ t.column :last_consistency_check_issues_issuable_id, :bigint, null: true
+
+ t.column :last_consistency_check_merge_requests_stage_event_hash_id, :bigint, null: true
+ t.column :last_consistency_check_merge_requests_start_event_timestamp, :datetime_with_timezone, null: true
+ t.column :last_consistency_check_merge_requests_end_event_timestamp, :datetime_with_timezone, null: true
+ t.column :last_consistency_check_merge_requests_issuable_id, :bigint, null: true
+ end
+ end
+
+ def down
+ remove_column :analytics_cycle_analytics_aggregations, :last_consistency_check_issues_stage_event_hash_id
+ remove_column :analytics_cycle_analytics_aggregations, :last_consistency_check_issues_start_event_timestamp
+ remove_column :analytics_cycle_analytics_aggregations, :last_consistency_check_issues_end_event_timestamp
+ remove_column :analytics_cycle_analytics_aggregations, :last_consistency_check_issues_issuable_id
+ remove_column :analytics_cycle_analytics_aggregations, :last_consistency_check_merge_requests_stage_event_hash_id
+ remove_column :analytics_cycle_analytics_aggregations, :last_consistency_check_merge_requests_start_event_timestamp
+ remove_column :analytics_cycle_analytics_aggregations, :last_consistency_check_merge_requests_end_event_timestamp
+ remove_column :analytics_cycle_analytics_aggregations, :last_consistency_check_merge_requests_issuable_id
+ end
+end