diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
commit | 71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch) | |
tree | 6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /db/post_migrate/20210609125005_drop_non_partitioned_web_hook_logs.rb | |
parent | a7253423e3403b8c08f8a161e5937e1488f5f407 (diff) |
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'db/post_migrate/20210609125005_drop_non_partitioned_web_hook_logs.rb')
-rw-r--r-- | db/post_migrate/20210609125005_drop_non_partitioned_web_hook_logs.rb | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/db/post_migrate/20210609125005_drop_non_partitioned_web_hook_logs.rb b/db/post_migrate/20210609125005_drop_non_partitioned_web_hook_logs.rb deleted file mode 100644 index 596b643e079..00000000000 --- a/db/post_migrate/20210609125005_drop_non_partitioned_web_hook_logs.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -class DropNonPartitionedWebHookLogs < ActiveRecord::Migration[6.1] - include Gitlab::Database::MigrationHelpers - include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers - - DOWNTIME = false - - def up - drop_nonpartitioned_archive_table(:web_hook_logs) - end - - def down - execute(<<~SQL) - CREATE TABLE web_hook_logs_archived ( - id integer NOT NULL, - web_hook_id integer NOT NULL, - trigger character varying, - url character varying, - request_headers text, - request_data text, - response_headers text, - response_body text, - response_status character varying, - execution_duration double precision, - internal_error_message character varying, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL - ); - - ALTER TABLE ONLY web_hook_logs_archived ADD CONSTRAINT web_hook_logs_archived_pkey PRIMARY KEY (id); - - CREATE INDEX index_web_hook_logs_on_created_at_and_web_hook_id ON web_hook_logs_archived USING btree (created_at, web_hook_id); - CREATE INDEX index_web_hook_logs_on_web_hook_id ON web_hook_logs_archived USING btree (web_hook_id); - - ALTER TABLE ONLY web_hook_logs_archived ADD CONSTRAINT fk_rails_666826e111 FOREIGN KEY (web_hook_id) REFERENCES web_hooks(id) ON DELETE CASCADE; - SQL - - with_lock_retries do - create_trigger_to_sync_tables(:web_hook_logs, :web_hook_logs_archived, 'id') - end - end -end |