Skip to content
代码片段 群组 项目
提交 f20e34af 编辑于 作者: Maxime Orefice's avatar Maxime Orefice 提交者: Michał Zając
浏览文件

Drop tmp_index_ci_job_artifacts_on_id_expire_at_file_type_trace

Changelog: removed
上级 fa28b9cf
No related branches found
No related tags found
无相关合并请求
# frozen_string_literal: true
class DropTmpIndexJobArtifactsIdAndExpireAt < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
TABLE_NAME = :ci_job_artifacts
INDEX_NAME = :tmp_index_ci_job_artifacts_on_id_expire_at_file_type_trace
EXPIRE_AT_ON_22_MIDNIGHT_IN_TIMEZONE_OR_TRACE = <<~SQL
(EXTRACT(day FROM timezone('UTC', expire_at)) IN (21, 22, 23)
AND EXTRACT(minute FROM timezone('UTC', expire_at)) IN (0, 30, 45)
AND EXTRACT(second FROM timezone('UTC', expire_at)) = 0)
OR file_type = 3
SQL
def up
remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME)
end
def down
add_concurrent_index(
TABLE_NAME,
:id,
where: EXPIRE_AT_ON_22_MIDNIGHT_IN_TIMEZONE_OR_TRACE,
name: INDEX_NAME
)
end
end
7169f6ef838ca3992d32b92a8cda4063d147c7ffe64cc382d69ae92eca525d0b
\ No newline at end of file
......@@ -33629,8 +33629,6 @@ CREATE INDEX tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99 ON v
 
CREATE INDEX tmp_index_ci_job_artifacts_on_expire_at_where_locked_unknown ON ci_job_artifacts USING btree (expire_at, job_id) WHERE ((locked = 2) AND (expire_at IS NOT NULL));
 
CREATE INDEX tmp_index_ci_job_artifacts_on_id_expire_at_file_type_trace ON ci_job_artifacts USING btree (id) WHERE (((date_part('day'::text, timezone('UTC'::text, expire_at)) = ANY (ARRAY[(21)::double precision, (22)::double precision, (23)::double precision])) AND (date_part('minute'::text, timezone('UTC'::text, expire_at)) = ANY (ARRAY[(0)::double precision, (30)::double precision, (45)::double precision])) AND (date_part('second'::text, timezone('UTC'::text, expire_at)) = (0)::double precision)) OR (file_type = 3));
CREATE INDEX tmp_index_cis_vulnerability_reads_on_id ON vulnerability_reads USING btree (id) WHERE (report_type = 7);
 
CREATE INDEX tmp_index_for_backfilling_resource_link_events ON system_note_metadata USING btree (id) WHERE (((action)::text = 'relate_to_parent'::text) OR ((action)::text = 'unrelate_from_parent'::text));
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册