Create ci_runner_taggings table
What does this MR do and why?
This MR adds the ci_runner_taggings
table so that we can later refactor the acts_as_taggable
table. It is the missing part of #467199 (closed), after !158327 (merged) created the p_ci_builds_tags
table.
The table is partitioned by runner_type
, where instance_type
is exempt from sharding.
Changelog: added
References
Please include cross links to any resources that are relevant to this MR This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
- Create ci_runners_taggings partitioned table (#467197 - closed)
- Create ci_runners_e59bb2812d partitioned table (!166308 - merged)
- Create table p_ci_build_tags (!158327 - merged)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
n/a
Migration
Migration output
$ bin/rails db:migrate RAILS_ENV=test
DEPRECATION WARNING: Support for Rails versions < 7.1 is deprecated and will be removed from ViewComponent 4.0.0 (ViewComponent v4 will remove support for Rails versions < 7.1 no earlier than April 1, 2025) (called from <main> at /Users/pedropombeiro/gitlab-development-kit/gitlab/config/environment.rb:7)
Running via Spring preloader in process 12127
main: == [advisory_lock_connection] object_id: 121880, pg_backend_pid: 12151
main: == 20241028095642 CreateCiRunnerTaggings: migrating ===========================
main: -- create_table(:ci_runner_taggings, {:if_not_exists=>true, :options=>"PARTITION BY LIST (runner_type)", :primary_key=>["id", "runner_type"]})
main: -> 0.0243s
I, [2024-11-13T15:23:24.354816 #12127] INFO -- : Database: 'main', Table: 'ci_runner_taggings': Lock Writes
main: == 20241028095642 CreateCiRunnerTaggings: migrated (0.0649s) ==================
main: == [advisory_lock_connection] object_id: 121880, pg_backend_pid: 12151
ci: == [advisory_lock_connection] object_id: 123620, pg_backend_pid: 12155
ci: == 20241028095642 CreateCiRunnerTaggings: migrating ===========================
ci: -- create_table(:ci_runner_taggings, {:if_not_exists=>true, :options=>"PARTITION BY LIST (runner_type)", :primary_key=>["id", "runner_type"]})
ci: -> 0.0145s
ci: == 20241028095642 CreateCiRunnerTaggings: migrated (0.0244s) ==================
ci: == [advisory_lock_connection] object_id: 123620, pg_backend_pid: 12155
main: == [advisory_lock_connection] object_id: 123920, pg_backend_pid: 12159
main: == 20241028100228 EnsureUniqueIdForCiRunnerTaggings: migrating ================
main: -- current_schema(nil)
main: -> 0.0003s
main: -- change_column_default(:ci_runner_taggings, :id, nil)
main: -> 0.0030s
main: -- execute("CREATE OR REPLACE FUNCTION assign_ci_runner_taggings_id_value()\nRETURNS TRIGGER AS\n$$\nBEGIN\nIF NEW.\"id\" IS NOT NULL THEN\n RAISE WARNING 'Manually assigning ids is not allowed, the value will be ignored';\nEND IF;\nNEW.\"id\" := nextval('ci_runner_taggings_id_seq'::regclass);\nRETURN NEW;\n\nEND\n$$ LANGUAGE PLPGSQL\n")
main: -> 0.0047s
main: -- execute("CREATE TRIGGER assign_ci_runner_taggings_id_trigger\nBEFORE INSERT ON ci_runner_taggings\nFOR EACH ROW\n\nEXECUTE FUNCTION assign_ci_runner_taggings_id_value()\n")
main: -> 0.0015s
main: == 20241028100228 EnsureUniqueIdForCiRunnerTaggings: migrated (0.0322s) =======
main: == [advisory_lock_connection] object_id: 123920, pg_backend_pid: 12159
ci: == [advisory_lock_connection] object_id: 125200, pg_backend_pid: 12163
ci: == 20241028100228 EnsureUniqueIdForCiRunnerTaggings: migrating ================
ci: -- current_schema(nil)
ci: -> 0.0005s
ci: -- change_column_default(:ci_runner_taggings, :id, nil)
ci: -> 0.0083s
ci: -- execute("CREATE OR REPLACE FUNCTION assign_ci_runner_taggings_id_value()\nRETURNS TRIGGER AS\n$$\nBEGIN\nIF NEW.\"id\" IS NOT NULL THEN\n RAISE WARNING 'Manually assigning ids is not allowed, the value will be ignored';\nEND IF;\nNEW.\"id\" := nextval('ci_runner_taggings_id_seq'::regclass);\nRETURN NEW;\n\nEND\n$$ LANGUAGE PLPGSQL\n")
ci: -> 0.0092s
ci: -- execute("CREATE TRIGGER assign_ci_runner_taggings_id_trigger\nBEFORE INSERT ON ci_runner_taggings\nFOR EACH ROW\n\nEXECUTE FUNCTION assign_ci_runner_taggings_id_value()\n")
ci: -> 0.0019s
ci: == 20241028100228 EnsureUniqueIdForCiRunnerTaggings: migrated (0.0474s) =======
ci: == [advisory_lock_connection] object_id: 125200, pg_backend_pid: 12163
main: == [advisory_lock_connection] object_id: 134280, pg_backend_pid: 12167
main: == 20241028102155 CreatePartitionsForCiRunnerTaggings: migrating ==============
main: -- current_schema(nil)
main: -> 0.0004s
main: -- current_schema(nil)
main: -> 0.0003s
main: -- execute("CREATE TABLE public.ci_runner_taggings_instance_type PARTITION OF ci_runner_taggings\nFOR VALUES IN (1)\n")
main: -> 0.0133s
main: -- current_schema(nil)
main: -> 0.0004s
main: -- current_schema(nil)
main: -> 0.0003s
main: -- execute("CREATE TABLE public.ci_runner_taggings_group_type PARTITION OF ci_runner_taggings\nFOR VALUES IN (2)\n")
main: -> 0.0049s
main: -- current_schema(nil)
main: -> 0.0005s
main: -- current_schema(nil)
main: -> 0.0003s
main: -- execute("CREATE TABLE public.ci_runner_taggings_project_type PARTITION OF ci_runner_taggings\nFOR VALUES IN (3)\n")
main: -> 0.0098s
I, [2024-11-13T15:23:25.220478 #12127] INFO -- : Database: 'main', Table: 'ci_runner_taggings_instance_type': Lock Writes
I, [2024-11-13T15:23:25.224504 #12127] INFO -- : Database: 'main', Table: 'ci_runner_taggings_group_type': Lock Writes
I, [2024-11-13T15:23:25.227998 #12127] INFO -- : Database: 'main', Table: 'ci_runner_taggings_project_type': Lock Writes
main: == 20241028102155 CreatePartitionsForCiRunnerTaggings: migrated (0.0545s) =====
main: == [advisory_lock_connection] object_id: 134280, pg_backend_pid: 12167
ci: == [advisory_lock_connection] object_id: 143040, pg_backend_pid: 12169
ci: == 20241028102155 CreatePartitionsForCiRunnerTaggings: migrating ==============
ci: -- current_schema(nil)
ci: -> 0.0003s
ci: -- current_schema(nil)
ci: -> 0.0003s
ci: -- execute("CREATE TABLE public.ci_runner_taggings_instance_type PARTITION OF ci_runner_taggings\nFOR VALUES IN (1)\n")
ci: -> 0.0098s
ci: -- current_schema(nil)
ci: -> 0.0003s
ci: -- current_schema(nil)
ci: -> 0.0001s
ci: -- execute("CREATE TABLE public.ci_runner_taggings_group_type PARTITION OF ci_runner_taggings\nFOR VALUES IN (2)\n")
ci: -> 0.0039s
ci: -- current_schema(nil)
ci: -> 0.0003s
ci: -- current_schema(nil)
ci: -> 0.0003s
ci: -- execute("CREATE TABLE public.ci_runner_taggings_project_type PARTITION OF ci_runner_taggings\nFOR VALUES IN (3)\n")
ci: -> 0.0091s
ci: == 20241028102155 CreatePartitionsForCiRunnerTaggings: migrated (0.0401s) =====
ci: == [advisory_lock_connection] object_id: 143040, pg_backend_pid: 12169
main: == [advisory_lock_connection] object_id: 143500, pg_backend_pid: 12172
main: == 20241028124628 AddShardingKeyCheckConstraintToCiRunnerTaggings: migrating ==
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("ALTER TABLE ci_runner_taggings_instance_type\nADD CONSTRAINT check_sharding_key_id_nullness\nCHECK ( sharding_key_id IS NULL )\nNOT VALID;\n")
main: -> 0.0017s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0004s
main: -- execute("ALTER TABLE ci_runner_taggings_instance_type VALIDATE CONSTRAINT check_sharding_key_id_nullness;")
main: -> 0.0009s
main: -- execute("RESET statement_timeout")
main: -> 0.0006s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("ALTER TABLE ci_runner_taggings_group_type\nADD CONSTRAINT check_sharding_key_id_nullness\nCHECK ( sharding_key_id IS NOT NULL )\nNOT VALID;\n")
main: -> 0.0010s
main: -- execute("ALTER TABLE ci_runner_taggings_group_type VALIDATE CONSTRAINT check_sharding_key_id_nullness;")
main: -> 0.0026s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("ALTER TABLE ci_runner_taggings_project_type\nADD CONSTRAINT check_sharding_key_id_nullness\nCHECK ( sharding_key_id IS NOT NULL )\nNOT VALID;\n")
main: -> 0.0008s
main: -- execute("ALTER TABLE ci_runner_taggings_project_type VALIDATE CONSTRAINT check_sharding_key_id_nullness;")
main: -> 0.0006s
main: == 20241028124628 AddShardingKeyCheckConstraintToCiRunnerTaggings: migrated (0.0402s)
main: == [advisory_lock_connection] object_id: 143500, pg_backend_pid: 12172
ci: == [advisory_lock_connection] object_id: 148480, pg_backend_pid: 12174
ci: == 20241028124628 AddShardingKeyCheckConstraintToCiRunnerTaggings: migrating ==
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0001s
ci: -- execute("ALTER TABLE ci_runner_taggings_instance_type\nADD CONSTRAINT check_sharding_key_id_nullness\nCHECK ( sharding_key_id IS NULL )\nNOT VALID;\n")
ci: -> 0.0011s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0005s
ci: -- execute("ALTER TABLE ci_runner_taggings_instance_type VALIDATE CONSTRAINT check_sharding_key_id_nullness;")
ci: -> 0.0008s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0009s
ci: -- transaction_open?(nil)
ci: -> 0.0001s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("ALTER TABLE ci_runner_taggings_group_type\nADD CONSTRAINT check_sharding_key_id_nullness\nCHECK ( sharding_key_id IS NOT NULL )\nNOT VALID;\n")
ci: -> 0.0009s
ci: -- execute("ALTER TABLE ci_runner_taggings_group_type VALIDATE CONSTRAINT check_sharding_key_id_nullness;")
ci: -> 0.0029s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("ALTER TABLE ci_runner_taggings_project_type\nADD CONSTRAINT check_sharding_key_id_nullness\nCHECK ( sharding_key_id IS NOT NULL )\nNOT VALID;\n")
ci: -> 0.0071s
ci: -- execute("ALTER TABLE ci_runner_taggings_project_type VALIDATE CONSTRAINT check_sharding_key_id_nullness;")
ci: -> 0.0013s
ci: == 20241028124628 AddShardingKeyCheckConstraintToCiRunnerTaggings: migrated (0.0515s)
ci: == [advisory_lock_connection] object_id: 148480, pg_backend_pid: 12174
main: == [advisory_lock_connection] object_id: 160160, pg_backend_pid: 12177
main: == 20241028104641 AddFkFromCiRunnerTaggingsToPartitionedCiRunners: migrating ==
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("LOCK TABLE instance_type_ci_runners_e59bb2812d, ci_runner_taggings_instance_type IN SHARE ROW EXCLUSIVE MODE")
main: -> 0.0014s
main: -- execute("ALTER TABLE ci_runner_taggings_instance_type ADD CONSTRAINT fk_rails_84f15fe4c6 FOREIGN KEY (runner_id, runner_type) REFERENCES instance_type_ci_runners_e59bb2812d (id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;")
main: -> 0.0038s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0005s
main: -- execute("ALTER TABLE ci_runner_taggings_instance_type VALIDATE CONSTRAINT fk_rails_84f15fe4c6;")
main: -> 0.0114s
main: -- execute("RESET statement_timeout")
main: -> 0.0011s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("LOCK TABLE group_type_ci_runners_e59bb2812d, ci_runner_taggings_group_type IN SHARE ROW EXCLUSIVE MODE")
main: -> 0.0088s
main: -- execute("ALTER TABLE ci_runner_taggings_group_type ADD CONSTRAINT fk_rails_84f15fe4c6 FOREIGN KEY (runner_id, runner_type) REFERENCES group_type_ci_runners_e59bb2812d (id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;")
main: -> 0.0034s
main: -- execute("ALTER TABLE ci_runner_taggings_group_type VALIDATE CONSTRAINT fk_rails_84f15fe4c6;")
main: -> 0.0072s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("LOCK TABLE project_type_ci_runners_e59bb2812d, ci_runner_taggings_project_type IN SHARE ROW EXCLUSIVE MODE")
main: -> 0.0008s
main: -- execute("ALTER TABLE ci_runner_taggings_project_type ADD CONSTRAINT fk_rails_84f15fe4c6 FOREIGN KEY (runner_id, runner_type) REFERENCES project_type_ci_runners_e59bb2812d (id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;")
main: -> 0.0030s
main: -- execute("ALTER TABLE ci_runner_taggings_project_type VALIDATE CONSTRAINT fk_rails_84f15fe4c6;")
main: -> 0.0076s
main: == 20241028104641 AddFkFromCiRunnerTaggingsToPartitionedCiRunners: migrated (0.1172s)
main: == [advisory_lock_connection] object_id: 160160, pg_backend_pid: 12177
ci: == [advisory_lock_connection] object_id: 185520, pg_backend_pid: 12179
ci: == 20241028104641 AddFkFromCiRunnerTaggingsToPartitionedCiRunners: migrating ==
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("LOCK TABLE instance_type_ci_runners_e59bb2812d, ci_runner_taggings_instance_type IN SHARE ROW EXCLUSIVE MODE")
ci: -> 0.0015s
ci: -- execute("ALTER TABLE ci_runner_taggings_instance_type ADD CONSTRAINT fk_rails_84f15fe4c6 FOREIGN KEY (runner_id, runner_type) REFERENCES instance_type_ci_runners_e59bb2812d (id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;")
ci: -> 0.0040s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0005s
ci: -- execute("ALTER TABLE ci_runner_taggings_instance_type VALIDATE CONSTRAINT fk_rails_84f15fe4c6;")
ci: -> 0.0100s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0006s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("LOCK TABLE group_type_ci_runners_e59bb2812d, ci_runner_taggings_group_type IN SHARE ROW EXCLUSIVE MODE")
ci: -> 0.0008s
ci: -- execute("ALTER TABLE ci_runner_taggings_group_type ADD CONSTRAINT fk_rails_84f15fe4c6 FOREIGN KEY (runner_id, runner_type) REFERENCES group_type_ci_runners_e59bb2812d (id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;")
ci: -> 0.0027s
ci: -- execute("ALTER TABLE ci_runner_taggings_group_type VALIDATE CONSTRAINT fk_rails_84f15fe4c6;")
ci: -> 0.0158s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("LOCK TABLE project_type_ci_runners_e59bb2812d, ci_runner_taggings_project_type IN SHARE ROW EXCLUSIVE MODE")
ci: -> 0.0006s
ci: -- execute("ALTER TABLE ci_runner_taggings_project_type ADD CONSTRAINT fk_rails_84f15fe4c6 FOREIGN KEY (runner_id, runner_type) REFERENCES project_type_ci_runners_e59bb2812d (id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;")
ci: -> 0.0017s
ci: -- execute("ALTER TABLE ci_runner_taggings_project_type VALIDATE CONSTRAINT fk_rails_84f15fe4c6;")
ci: -> 0.0071s
ci: == 20241028104641 AddFkFromCiRunnerTaggingsToPartitionedCiRunners: migrated (0.1205s)
ci: == [advisory_lock_connection] object_id: 185520, pg_backend_pid: 12179
main: == [advisory_lock_connection] object_id: 203200, pg_backend_pid: 12182
main: == 20241028110657 AddFkFromCiRunnerTaggingsToTags: migrating ==================
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("LOCK TABLE tags, public.ci_runner_taggings_group_type IN SHARE ROW EXCLUSIVE MODE")
main: -> 0.0007s
main: -- execute("ALTER TABLE public.ci_runner_taggings_group_type ADD CONSTRAINT fk_rails_6d510634c7 FOREIGN KEY (tag_id) REFERENCES tags (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0029s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0013s
main: -- execute("ALTER TABLE public.ci_runner_taggings_group_type VALIDATE CONSTRAINT fk_rails_6d510634c7;")
main: -> 0.0045s
main: -- execute("RESET statement_timeout")
main: -> 0.0005s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("LOCK TABLE tags, public.ci_runner_taggings_instance_type IN SHARE ROW EXCLUSIVE MODE")
main: -> 0.0006s
main: -- execute("ALTER TABLE public.ci_runner_taggings_instance_type ADD CONSTRAINT fk_rails_6d510634c7 FOREIGN KEY (tag_id) REFERENCES tags (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0013s
main: -- execute("ALTER TABLE public.ci_runner_taggings_instance_type VALIDATE CONSTRAINT fk_rails_6d510634c7;")
main: -> 0.0010s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("LOCK TABLE tags, public.ci_runner_taggings_project_type IN SHARE ROW EXCLUSIVE MODE")
main: -> 0.0010s
main: -- execute("ALTER TABLE public.ci_runner_taggings_project_type ADD CONSTRAINT fk_rails_6d510634c7 FOREIGN KEY (tag_id) REFERENCES tags (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0015s
main: -- execute("ALTER TABLE public.ci_runner_taggings_project_type VALIDATE CONSTRAINT fk_rails_6d510634c7;")
main: -> 0.0010s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- transaction_open?(nil)
main: -> 0.0000s
main: -- execute("LOCK TABLE tags, ci_runner_taggings IN ACCESS EXCLUSIVE MODE")
main: -> 0.0010s
main: -- execute("ALTER TABLE ci_runner_taggings ADD CONSTRAINT fk_rails_6d510634c7 FOREIGN KEY (tag_id) REFERENCES tags (id) ON DELETE CASCADE ;")
main: -> 0.0014s
main: -- execute("ALTER TABLE ci_runner_taggings VALIDATE CONSTRAINT fk_rails_6d510634c7;")
main: -> 0.0006s
main: == 20241028110657 AddFkFromCiRunnerTaggingsToTags: migrated (0.1103s) =========
main: == [advisory_lock_connection] object_id: 203200, pg_backend_pid: 12182
ci: == [advisory_lock_connection] object_id: 227220, pg_backend_pid: 12185
ci: == 20241028110657 AddFkFromCiRunnerTaggingsToTags: migrating ==================
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0001s
ci: -- execute("LOCK TABLE tags, public.ci_runner_taggings_group_type IN SHARE ROW EXCLUSIVE MODE")
ci: -> 0.0010s
ci: -- execute("ALTER TABLE public.ci_runner_taggings_group_type ADD CONSTRAINT fk_rails_6d510634c7 FOREIGN KEY (tag_id) REFERENCES tags (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0035s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0004s
ci: -- execute("ALTER TABLE public.ci_runner_taggings_group_type VALIDATE CONSTRAINT fk_rails_6d510634c7;")
ci: -> 0.0038s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0007s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("LOCK TABLE tags, public.ci_runner_taggings_instance_type IN SHARE ROW EXCLUSIVE MODE")
ci: -> 0.0107s
ci: -- execute("ALTER TABLE public.ci_runner_taggings_instance_type ADD CONSTRAINT fk_rails_6d510634c7 FOREIGN KEY (tag_id) REFERENCES tags (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0011s
ci: -- execute("ALTER TABLE public.ci_runner_taggings_instance_type VALIDATE CONSTRAINT fk_rails_6d510634c7;")
ci: -> 0.0072s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("LOCK TABLE tags, public.ci_runner_taggings_project_type IN SHARE ROW EXCLUSIVE MODE")
ci: -> 0.0007s
ci: -- execute("ALTER TABLE public.ci_runner_taggings_project_type ADD CONSTRAINT fk_rails_6d510634c7 FOREIGN KEY (tag_id) REFERENCES tags (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0009s
ci: -- execute("ALTER TABLE public.ci_runner_taggings_project_type VALIDATE CONSTRAINT fk_rails_6d510634c7;")
ci: -> 0.0013s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- transaction_open?(nil)
ci: -> 0.0000s
ci: -- execute("LOCK TABLE tags, ci_runner_taggings IN ACCESS EXCLUSIVE MODE")
ci: -> 0.0008s
ci: -- execute("ALTER TABLE ci_runner_taggings ADD CONSTRAINT fk_rails_6d510634c7 FOREIGN KEY (tag_id) REFERENCES tags (id) ON DELETE CASCADE ;")
ci: -> 0.0018s
ci: -- execute("ALTER TABLE ci_runner_taggings VALIDATE CONSTRAINT fk_rails_6d510634c7;")
ci: -> 0.0006s
ci: == 20241028110657 AddFkFromCiRunnerTaggingsToTags: migrated (0.1318s) =========
ci: == [advisory_lock_connection] object_id: 227220, pg_backend_pid: 12185
Table schemas
ci_runner_taggings
Partitioned table "public.ci_runner_taggings"
┌─────────────────┬──────────┬───────────┬──────────┬─────────┬─────────┬─────────────┬──────────────┬─────────────┐
│ Column │ Type │ Collation │ Nullable │ Default │ Storage │ Compression │ Stats target │ Description │
├─────────────────┼──────────┼───────────┼──────────┼─────────┼─────────┼─────────────┼──────────────┼─────────────┤
│ id │ bigint │ │ not null │ │ plain │ │ │ │
│ tag_id │ bigint │ │ not null │ │ plain │ │ │ │
│ runner_id │ bigint │ │ not null │ │ plain │ │ │ │
│ sharding_key_id │ bigint │ │ │ │ plain │ │ │ │
│ runner_type │ smallint │ │ not null │ │ plain │ │ │ │
└─────────────────┴──────────┴───────────┴──────────┴─────────┴─────────┴─────────────┴──────────────┴─────────────┘
Partition key: LIST (runner_type)
Indexes:
"ci_runner_taggings_pkey" PRIMARY KEY, btree (id, runner_type)
"index_ci_runner_taggings_on_runner_id_and_runner_type" btree (runner_id, runner_type)
"index_ci_runner_taggings_on_sharding_key_id" btree (sharding_key_id)
"index_ci_runner_taggings_on_tag_id_runner_id_and_runner_type" UNIQUE, btree (tag_id, runner_id, runner_type)
Foreign-key constraints:
"fk_rails_6d510634c7" FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE
Triggers:
assign_ci_runner_taggings_id_trigger BEFORE INSERT ON ci_runner_taggings FOR EACH ROW EXECUTE FUNCTION assign_ci_runner_taggings_id_value()
Partitions: ci_runner_taggings_group_type FOR VALUES IN ('2'),
ci_runner_taggings_instance_type FOR VALUES IN ('1'),
ci_runner_taggings_project_type FOR VALUES IN ('3')
ci_runner_taggings_instance_type
Table "public.ci_runner_taggings_instance_type"
┌─────────────────┬──────────┬───────────┬──────────┬─────────┐
│ Column │ Type │ Collation │ Nullable │ Default │
├─────────────────┼──────────┼───────────┼──────────┼─────────┤
│ id │ bigint │ │ not null │ │
│ tag_id │ bigint │ │ not null │ │
│ runner_id │ bigint │ │ not null │ │
│ sharding_key_id │ bigint │ │ │ │
│ runner_type │ smallint │ │ not null │ │
└─────────────────┴──────────┴───────────┴──────────┴─────────┘
Partition of: ci_runner_taggings FOR VALUES IN ('1')
Indexes:
"ci_runner_taggings_instance_type_pkey" PRIMARY KEY, btree (id, runner_type)
"ci_runner_taggings_instance_ty_tag_id_runner_id_runner_type_idx" UNIQUE, btree (tag_id, runner_id, runner_type)
"ci_runner_taggings_instance_type_runner_id_runner_type_idx" btree (runner_id, runner_type)
"ci_runner_taggings_instance_type_sharding_key_id_idx" btree (sharding_key_id)
Check constraints:
"check_sharding_key_id_nullness" CHECK (sharding_key_id IS NULL)
Foreign-key constraints:
"fk_rails_84f15fe4c6" FOREIGN KEY (runner_id, runner_type) REFERENCES instance_type_ci_runners_e59bb2812d(id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE
TABLE "ci_runner_taggings" CONSTRAINT "fk_rails_6d510634c7" FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE
Triggers:
assign_ci_runner_taggings_id_trigger BEFORE INSERT ON ci_runner_taggings_instance_type FOR EACH ROW EXECUTE FUNCTION assign_ci_runner_taggings_id_value(), ON TABLE ci_runner_taggings
ci_runner_taggings_group_type
Table "public.ci_runner_taggings_group_type"
┌─────────────────┬──────────┬───────────┬──────────┬─────────┐
│ Column │ Type │ Collation │ Nullable │ Default │
├─────────────────┼──────────┼───────────┼──────────┼─────────┤
│ id │ bigint │ │ not null │ │
│ tag_id │ bigint │ │ not null │ │
│ runner_id │ bigint │ │ not null │ │
│ sharding_key_id │ bigint │ │ │ │
│ runner_type │ smallint │ │ not null │ │
└─────────────────┴──────────┴───────────┴──────────┴─────────┘
Partition of: ci_runner_taggings FOR VALUES IN ('2')
Indexes:
"ci_runner_taggings_group_type_pkey" PRIMARY KEY, btree (id, runner_type)
"ci_runner_taggings_group_type_runner_id_runner_type_idx" btree (runner_id, runner_type)
"ci_runner_taggings_group_type_sharding_key_id_idx" btree (sharding_key_id)
"ci_runner_taggings_group_type_tag_id_runner_id_runner_type_idx" UNIQUE, btree (tag_id, runner_id, runner_type)
Check constraints:
"check_sharding_key_id_nullness" CHECK (sharding_key_id IS NOT NULL)
Foreign-key constraints:
"fk_rails_84f15fe4c6" FOREIGN KEY (runner_id, runner_type) REFERENCES group_type_ci_runners_e59bb2812d(id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE
TABLE "ci_runner_taggings" CONSTRAINT "fk_rails_6d510634c7" FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE
Triggers:
assign_ci_runner_taggings_id_trigger BEFORE INSERT ON ci_runner_taggings_group_type FOR EACH ROW EXECUTE FUNCTION assign_ci_runner_taggings_id_value(), ON TABLE ci_runner_taggings
ci_runner_taggings_project_type
Table "public.ci_runner_taggings_project_type"
┌─────────────────┬──────────┬───────────┬──────────┬─────────┐
│ Column │ Type │ Collation │ Nullable │ Default │
├─────────────────┼──────────┼───────────┼──────────┼─────────┤
│ id │ bigint │ │ not null │ │
│ tag_id │ bigint │ │ not null │ │
│ runner_id │ bigint │ │ not null │ │
│ sharding_key_id │ bigint │ │ │ │
│ runner_type │ smallint │ │ not null │ │
└─────────────────┴──────────┴───────────┴──────────┴─────────┘
Partition of: ci_runner_taggings FOR VALUES IN ('3')
Indexes:
"ci_runner_taggings_project_type_pkey" PRIMARY KEY, btree (id, runner_type)
"ci_runner_taggings_project_typ_tag_id_runner_id_runner_type_idx" UNIQUE, btree (tag_id, runner_id, runner_type)
"ci_runner_taggings_project_type_runner_id_runner_type_idx" btree (runner_id, runner_type)
"ci_runner_taggings_project_type_sharding_key_id_idx" btree (sharding_key_id)
Check constraints:
"check_sharding_key_id_nullness" CHECK (sharding_key_id IS NOT NULL)
Foreign-key constraints:
"fk_rails_84f15fe4c6" FOREIGN KEY (runner_id, runner_type) REFERENCES project_type_ci_runners_e59bb2812d(id, runner_type) ON UPDATE CASCADE ON DELETE CASCADE
TABLE "ci_runner_taggings" CONSTRAINT "fk_rails_6d510634c7" FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE
Triggers:
assign_ci_runner_taggings_id_trigger BEFORE INSERT ON ci_runner_taggings_project_type FOR EACH ROW EXECUTE FUNCTION assign_ci_runner_taggings_id_value(), ON TABLE ci_runner_taggings