From c4f6b72f449326ee7c76a27b0dde8afe453c52fb Mon Sep 17 00:00:00 2001 From: Omar Qunsul Date: Fri, 12 Dec 2025 17:42:49 +0100 Subject: [PATCH] Remove old knowledge graph code indexing related databaes schema Addressing: https://gitlab.com/gitlab-org/gitlab/-/issues/581020 Changelog: other --- config/gitlab_loose_foreign_keys.yml | 4 - .../p_knowledge_graph_enabled_namespaces.yml | 2 + .../p_knowledge_graph_replicas.yml | 2 + .../p_knowledge_graph_tasks.yml | 2 + ...ekt_node_knowledge_graph_schema_version.rb | 13 ++ ...9_drop_table_p_knowledge_graph_replicas.rb | 47 +++++++ ...le_p_knowledge_graph_enabled_namespaces.rb | 36 +++++ ...5137_drop_table_p_knowledge_graph_tasks.rb | 51 +++++++ db/schema_migrations/20251212162702 | 1 + db/schema_migrations/20251212163839 | 1 + db/schema_migrations/20251212164345 | 1 + db/schema_migrations/20251212165137 | 1 + db/structure.sql | 125 ------------------ ee/app/models/search/zoekt/node.rb | 2 +- 14 files changed, 158 insertions(+), 130 deletions(-) rename db/docs/{ => deleted_tables}/p_knowledge_graph_enabled_namespaces.yml (76%) rename db/docs/{ => deleted_tables}/p_knowledge_graph_replicas.yml (74%) rename db/docs/{ => deleted_tables}/p_knowledge_graph_tasks.yml (73%) create mode 100644 db/post_migrate/20251212162702_remove_column_zoekt_node_knowledge_graph_schema_version.rb create mode 100644 db/post_migrate/20251212163839_drop_table_p_knowledge_graph_replicas.rb create mode 100644 db/post_migrate/20251212164345_drop_table_p_knowledge_graph_enabled_namespaces.rb create mode 100644 db/post_migrate/20251212165137_drop_table_p_knowledge_graph_tasks.rb create mode 100644 db/schema_migrations/20251212162702 create mode 100644 db/schema_migrations/20251212163839 create mode 100644 db/schema_migrations/20251212164345 create mode 100644 db/schema_migrations/20251212165137 diff --git a/config/gitlab_loose_foreign_keys.yml b/config/gitlab_loose_foreign_keys.yml index 1a5156a97c448f..07646a064479ff 100644 --- a/config/gitlab_loose_foreign_keys.yml +++ b/config/gitlab_loose_foreign_keys.yml @@ -684,10 +684,6 @@ p_ci_workloads: - table: projects column: project_id on_delete: async_delete -p_knowledge_graph_replicas: - - table: p_knowledge_graph_enabled_namespaces - column: knowledge_graph_enabled_namespace_id - on_delete: async_nullify p_sent_notifications: - table: namespaces column: namespace_id diff --git a/db/docs/p_knowledge_graph_enabled_namespaces.yml b/db/docs/deleted_tables/p_knowledge_graph_enabled_namespaces.yml similarity index 76% rename from db/docs/p_knowledge_graph_enabled_namespaces.yml rename to db/docs/deleted_tables/p_knowledge_graph_enabled_namespaces.yml index 78ad9d172dcfaa..a4fcc91dd18ee5 100644 --- a/db/docs/p_knowledge_graph_enabled_namespaces.yml +++ b/db/docs/deleted_tables/p_knowledge_graph_enabled_namespaces.yml @@ -10,3 +10,5 @@ gitlab_schema: gitlab_main_org sharding_key: namespace_id: namespaces table_size: small +removed_by_url: 'https://gitlab.com/gitlab-org/gitlab/-/merge_requests/216324' +removed_in_milestone: '18.8' diff --git a/db/docs/p_knowledge_graph_replicas.yml b/db/docs/deleted_tables/p_knowledge_graph_replicas.yml similarity index 74% rename from db/docs/p_knowledge_graph_replicas.yml rename to db/docs/deleted_tables/p_knowledge_graph_replicas.yml index f1d307389d6981..cd43b67d0bc41c 100644 --- a/db/docs/p_knowledge_graph_replicas.yml +++ b/db/docs/deleted_tables/p_knowledge_graph_replicas.yml @@ -8,3 +8,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/191162 milestone: '18.1' gitlab_schema: gitlab_main_cell_local table_size: small +removed_by_url: 'https://gitlab.com/gitlab-org/gitlab/-/merge_requests/216324' +removed_in_milestone: '18.8' diff --git a/db/docs/p_knowledge_graph_tasks.yml b/db/docs/deleted_tables/p_knowledge_graph_tasks.yml similarity index 73% rename from db/docs/p_knowledge_graph_tasks.yml rename to db/docs/deleted_tables/p_knowledge_graph_tasks.yml index 632987db20900b..c2f2e054f04b4d 100644 --- a/db/docs/p_knowledge_graph_tasks.yml +++ b/db/docs/deleted_tables/p_knowledge_graph_tasks.yml @@ -7,3 +7,5 @@ description: Represents a knowledge graph task for a project namespace introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/192114 milestone: '18.1' gitlab_schema: gitlab_main_cell_local +removed_by_url: 'https://gitlab.com/gitlab-org/gitlab/-/merge_requests/216324' +removed_in_milestone: '18.8' diff --git a/db/post_migrate/20251212162702_remove_column_zoekt_node_knowledge_graph_schema_version.rb b/db/post_migrate/20251212162702_remove_column_zoekt_node_knowledge_graph_schema_version.rb new file mode 100644 index 00000000000000..f2ab4c4ecbf97d --- /dev/null +++ b/db/post_migrate/20251212162702_remove_column_zoekt_node_knowledge_graph_schema_version.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class RemoveColumnZoektNodeKnowledgeGraphSchemaVersion < Gitlab::Database::Migration[2.3] + milestone '18.8' + + def up + remove_column :zoekt_nodes, :knowledge_graph_schema_version + end + + def down + add_column :zoekt_nodes, :knowledge_graph_schema_version, :smallint, default: 0, null: false + end +end diff --git a/db/post_migrate/20251212163839_drop_table_p_knowledge_graph_replicas.rb b/db/post_migrate/20251212163839_drop_table_p_knowledge_graph_replicas.rb new file mode 100644 index 00000000000000..3423073edc9d66 --- /dev/null +++ b/db/post_migrate/20251212163839_drop_table_p_knowledge_graph_replicas.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +class DropTablePKnowledgeGraphReplicas < Gitlab::Database::Migration[2.3] + include Gitlab::Database::PartitioningMigrationHelpers::ForeignKeyHelpers + include Gitlab::Database::PartitioningMigrationHelpers + + disable_ddl_transaction! + milestone '18.8' + + def up + with_lock_retries do + drop_table :p_knowledge_graph_replicas, if_exists: true + end + end + + def down + with_lock_retries do + create_table :p_knowledge_graph_replicas, + options: 'PARTITION BY RANGE (namespace_id)', + primary_key: [:id, :namespace_id], if_not_exists: true do |t| + t.bigserial :id, null: false + t.bigint :namespace_id, null: false + t.bigint :knowledge_graph_enabled_namespace_id, null: true + t.bigint :zoekt_node_id, null: false, index: true + t.timestamps_with_timezone null: false + t.integer :state, null: false, index: true, default: 0, limit: 2 + t.integer :retries_left, limit: 2, null: false + t.bigint :reserved_storage_bytes, default: 10 * 1024 * 1024, null: false + t.datetime_with_timezone :indexed_at + t.column :schema_version, :smallint, default: 0, null: false + t.index :namespace_id, + name: 'index_p_knowledge_graph_replicas_on_namespace_id', using: :btree + t.index :schema_version, + name: 'index_p_knowledge_graph_replicas_on_schema_version', using: :btree + t.check_constraint 'retries_left > 0 OR retries_left = 0 AND state >= 200', + name: 'c_p_knowledge_graph_replicas_retries_status' + end + end + + add_concurrent_partitioned_foreign_key :p_knowledge_graph_replicas, :zoekt_nodes, + column: :zoekt_node_id, on_delete: :cascade + + add_concurrent_partitioned_index :p_knowledge_graph_replicas, + [:knowledge_graph_enabled_namespace_id, :zoekt_node_id, :namespace_id], unique: true, + name: 'p_knowledge_graph_replicas_namespace_id_and_zoekt_node_id' + end +end diff --git a/db/post_migrate/20251212164345_drop_table_p_knowledge_graph_enabled_namespaces.rb b/db/post_migrate/20251212164345_drop_table_p_knowledge_graph_enabled_namespaces.rb new file mode 100644 index 00000000000000..ca2dbc88a3ff13 --- /dev/null +++ b/db/post_migrate/20251212164345_drop_table_p_knowledge_graph_enabled_namespaces.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +class DropTablePKnowledgeGraphEnabledNamespaces < Gitlab::Database::Migration[2.3] + include Gitlab::Database::PartitioningMigrationHelpers::ForeignKeyHelpers + include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers + + disable_ddl_transaction! + milestone '18.8' + + def up + with_lock_retries do + drop_table :p_knowledge_graph_enabled_namespaces, if_exists: true + end + end + + def down + with_lock_retries do + create_table :p_knowledge_graph_enabled_namespaces, + options: 'PARTITION BY RANGE (namespace_id)', + primary_key: [:id, :namespace_id], if_not_exists: true do |t| + t.bigserial :id, null: false + t.bigint :namespace_id, null: false + t.timestamps_with_timezone null: false + t.integer :state, null: false, default: 0, limit: 2, index: true + t.index :namespace_id, unique: true + end + end + + unless has_loose_foreign_key?(:p_knowledge_graph_enabled_namespaces) + track_record_deletions_override_table_name(:p_knowledge_graph_enabled_namespaces) + end + + add_concurrent_partitioned_foreign_key :p_knowledge_graph_enabled_namespaces, :namespaces, + column: :namespace_id, on_delete: :cascade + end +end diff --git a/db/post_migrate/20251212165137_drop_table_p_knowledge_graph_tasks.rb b/db/post_migrate/20251212165137_drop_table_p_knowledge_graph_tasks.rb new file mode 100644 index 00000000000000..409e143f1259e1 --- /dev/null +++ b/db/post_migrate/20251212165137_drop_table_p_knowledge_graph_tasks.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +class DropTablePKnowledgeGraphTasks < Gitlab::Database::Migration[2.3] + include Gitlab::Database::PartitioningMigrationHelpers::UniquenessHelpers + + disable_ddl_transaction! + milestone '18.8' + + OPTIONS = { + primary_key: [:id, :partition_id], + options: 'PARTITION BY LIST (partition_id)', + if_not_exists: true + } + FAILED_STATE_ENUM = 255 + CONSTRAINT_QUERY = <<~SQL + (retries_left > 0) OR (retries_left = 0 AND state = #{FAILED_STATE_ENUM}) + SQL + SEQ_NAME = :p_knowledge_graph_tasks_id_seq + + def up + revert_ensure_unique_id(:p_knowledge_graph_tasks, seq: SEQ_NAME) + + with_lock_retries do + drop_table :p_knowledge_graph_tasks, if_exists: true + end + end + + def down + with_lock_retries do + create_table :p_knowledge_graph_tasks, if_not_exists: true, **OPTIONS do |t| + t.bigserial :id, null: false + t.bigint :partition_id, null: false, default: 1 + t.bigint :zoekt_node_id, null: false + t.bigint :namespace_id, null: false + t.bigint :knowledge_graph_replica_id, null: false + t.datetime_with_timezone :perform_at, null: false, default: -> { 'NOW()' } + t.timestamps_with_timezone null: false + t.integer :state, null: false, default: 0, limit: 2 + t.integer :task_type, null: false, limit: 2 + t.integer :retries_left, null: false, limit: 2 + t.index :state, name: 'index_p_knowledge_graph_tasks_on_state', using: :btree + t.index :knowledge_graph_replica_id + t.index [:zoekt_node_id, :state, :perform_at], + name: 'index_p_knowledge_graph_tasks_on_node_state_and_perform_at', using: :btree + t.check_constraint CONSTRAINT_QUERY, name: 'c_p_knowledge_graph_tasks_on_retries_left' + end + end + + ensure_unique_id(:p_knowledge_graph_tasks, seq: SEQ_NAME) + end +end diff --git a/db/schema_migrations/20251212162702 b/db/schema_migrations/20251212162702 new file mode 100644 index 00000000000000..e2b2bef084848c --- /dev/null +++ b/db/schema_migrations/20251212162702 @@ -0,0 +1 @@ +36cca2727388bf9a5b842f82f2e6cc07857920a6076503c991cde2feb617aab3 \ No newline at end of file diff --git a/db/schema_migrations/20251212163839 b/db/schema_migrations/20251212163839 new file mode 100644 index 00000000000000..a0e5c4fa440181 --- /dev/null +++ b/db/schema_migrations/20251212163839 @@ -0,0 +1 @@ +9e3dc3b54cc6a0cf36a71a8e0bf18a016a5669d9394ddb89b125a8daf8dfd995 \ No newline at end of file diff --git a/db/schema_migrations/20251212164345 b/db/schema_migrations/20251212164345 new file mode 100644 index 00000000000000..e93bebbbf66295 --- /dev/null +++ b/db/schema_migrations/20251212164345 @@ -0,0 +1 @@ +b7d98925ebec28e49e93860a7cd41a7758b3a8d9bb4887fa39df54e8c83dfe65 \ No newline at end of file diff --git a/db/schema_migrations/20251212165137 b/db/schema_migrations/20251212165137 new file mode 100644 index 00000000000000..58e7ec7391a51a --- /dev/null +++ b/db/schema_migrations/20251212165137 @@ -0,0 +1 @@ +ab53f1acc75ad3ecfba3fbc0d96c0c230ead9bb0654ceff141db9116685fb2c4 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 2188d6e075cd59..21a933ce4e8919 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -166,19 +166,6 @@ RETURN NEW; END $$; -CREATE FUNCTION assign_p_knowledge_graph_tasks_id_value() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN -IF NEW."id" IS NOT NULL THEN - RAISE WARNING 'Manually assigning ids is not allowed, the value will be ignored'; -END IF; -NEW."id" := nextval('p_knowledge_graph_tasks_id_seq'::regclass); -RETURN NEW; - -END -$$; - CREATE FUNCTION assign_zoekt_tasks_id_value() RETURNS trigger LANGUAGE plpgsql AS $$ @@ -22606,74 +22593,6 @@ CREATE SEQUENCE p_generated_ref_commits_id_seq ALTER SEQUENCE p_generated_ref_commits_id_seq OWNED BY p_generated_ref_commits.id; -CREATE TABLE p_knowledge_graph_enabled_namespaces ( - id bigint NOT NULL, - namespace_id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - state smallint DEFAULT 0 NOT NULL -) -PARTITION BY RANGE (namespace_id); - -CREATE SEQUENCE p_knowledge_graph_enabled_namespaces_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE p_knowledge_graph_enabled_namespaces_id_seq OWNED BY p_knowledge_graph_enabled_namespaces.id; - -CREATE TABLE p_knowledge_graph_replicas ( - id bigint NOT NULL, - namespace_id bigint NOT NULL, - knowledge_graph_enabled_namespace_id bigint, - zoekt_node_id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - state smallint DEFAULT 0 NOT NULL, - retries_left smallint NOT NULL, - reserved_storage_bytes bigint DEFAULT 10485760 NOT NULL, - indexed_at timestamp with time zone, - schema_version smallint DEFAULT 0 NOT NULL, - CONSTRAINT c_p_knowledge_graph_replicas_retries_status CHECK (((retries_left > 0) OR ((retries_left = 0) AND (state >= 200)))) -) -PARTITION BY RANGE (namespace_id); - -CREATE SEQUENCE p_knowledge_graph_replicas_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE p_knowledge_graph_replicas_id_seq OWNED BY p_knowledge_graph_replicas.id; - -CREATE TABLE p_knowledge_graph_tasks ( - id bigint NOT NULL, - partition_id bigint DEFAULT 1 NOT NULL, - zoekt_node_id bigint NOT NULL, - namespace_id bigint NOT NULL, - knowledge_graph_replica_id bigint NOT NULL, - perform_at timestamp with time zone DEFAULT now() NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - state smallint DEFAULT 0 NOT NULL, - task_type smallint NOT NULL, - retries_left smallint NOT NULL, - CONSTRAINT c_p_knowledge_graph_tasks_on_retries_left CHECK (((retries_left > 0) OR ((retries_left = 0) AND (state = 255)))) -) -PARTITION BY LIST (partition_id); - -CREATE SEQUENCE p_knowledge_graph_tasks_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE p_knowledge_graph_tasks_id_seq OWNED BY p_knowledge_graph_tasks.id; - CREATE SEQUENCE p_sent_notifications_id_seq START WITH 1 INCREMENT BY 1 @@ -31146,7 +31065,6 @@ CREATE TABLE zoekt_nodes ( usable_storage_bytes_locked_until timestamp with time zone, schema_version smallint DEFAULT 0 NOT NULL, services smallint[] DEFAULT '{0}'::smallint[] NOT NULL, - knowledge_graph_schema_version smallint DEFAULT 0 NOT NULL, CONSTRAINT check_32f39efba3 CHECK ((char_length(search_base_url) <= 1024)), CONSTRAINT check_38c354a3c2 CHECK ((char_length(index_base_url) <= 1024)) ); @@ -32884,10 +32802,6 @@ ALTER TABLE ONLY p_ci_workloads ALTER COLUMN id SET DEFAULT nextval('p_ci_worklo ALTER TABLE ONLY p_generated_ref_commits ALTER COLUMN id SET DEFAULT nextval('p_generated_ref_commits_id_seq'::regclass); -ALTER TABLE ONLY p_knowledge_graph_enabled_namespaces ALTER COLUMN id SET DEFAULT nextval('p_knowledge_graph_enabled_namespaces_id_seq'::regclass); - -ALTER TABLE ONLY p_knowledge_graph_replicas ALTER COLUMN id SET DEFAULT nextval('p_knowledge_graph_replicas_id_seq'::regclass); - ALTER TABLE ONLY packages_build_infos ALTER COLUMN id SET DEFAULT nextval('packages_build_infos_id_seq'::regclass); ALTER TABLE ONLY packages_conan_file_metadata ALTER COLUMN id SET DEFAULT nextval('packages_conan_file_metadata_id_seq'::regclass); @@ -36409,15 +36323,6 @@ ALTER TABLE ONLY p_duo_workflows_checkpoints ALTER TABLE ONLY p_generated_ref_commits ADD CONSTRAINT p_generated_ref_commits_pkey PRIMARY KEY (id, project_id); -ALTER TABLE ONLY p_knowledge_graph_enabled_namespaces - ADD CONSTRAINT p_knowledge_graph_enabled_namespaces_pkey PRIMARY KEY (id, namespace_id); - -ALTER TABLE ONLY p_knowledge_graph_replicas - ADD CONSTRAINT p_knowledge_graph_replicas_pkey PRIMARY KEY (id, namespace_id); - -ALTER TABLE ONLY p_knowledge_graph_tasks - ADD CONSTRAINT p_knowledge_graph_tasks_pkey PRIMARY KEY (id, partition_id); - ALTER TABLE ONLY p_sent_notifications ADD CONSTRAINT p_sent_notifications_pkey PRIMARY KEY (id, partition); @@ -43375,24 +43280,6 @@ CREATE INDEX index_p_duo_workflows_checkpoints_on_project_id ON ONLY p_duo_workf CREATE INDEX index_p_duo_workflows_checkpoints_thread ON ONLY p_duo_workflows_checkpoints USING btree (workflow_id, thread_ts); -CREATE UNIQUE INDEX index_p_knowledge_graph_enabled_namespaces_on_namespace_id ON ONLY p_knowledge_graph_enabled_namespaces USING btree (namespace_id); - -CREATE INDEX index_p_knowledge_graph_enabled_namespaces_on_state ON ONLY p_knowledge_graph_enabled_namespaces USING btree (state); - -CREATE INDEX index_p_knowledge_graph_replicas_on_namespace_id ON ONLY p_knowledge_graph_replicas USING btree (namespace_id); - -CREATE INDEX index_p_knowledge_graph_replicas_on_schema_version ON ONLY p_knowledge_graph_replicas USING btree (schema_version); - -CREATE INDEX index_p_knowledge_graph_replicas_on_state ON ONLY p_knowledge_graph_replicas USING btree (state); - -CREATE INDEX index_p_knowledge_graph_replicas_on_zoekt_node_id ON ONLY p_knowledge_graph_replicas USING btree (zoekt_node_id); - -CREATE INDEX index_p_knowledge_graph_tasks_on_knowledge_graph_replica_id ON ONLY p_knowledge_graph_tasks USING btree (knowledge_graph_replica_id); - -CREATE INDEX index_p_knowledge_graph_tasks_on_node_state_and_perform_at ON ONLY p_knowledge_graph_tasks USING btree (zoekt_node_id, state, perform_at); - -CREATE INDEX index_p_knowledge_graph_tasks_on_state ON ONLY p_knowledge_graph_tasks USING btree (state); - CREATE INDEX index_p_sent_notifications_on_issue_email_participant_id ON ONLY p_sent_notifications USING btree (issue_email_participant_id); CREATE INDEX index_p_sent_notifications_on_namespace_id ON ONLY p_sent_notifications USING btree (namespace_id); @@ -45689,8 +45576,6 @@ CREATE INDEX p_index_generated_ref_commits_on_merge_request_id ON ONLY p_generat CREATE INDEX p_index_generated_ref_commits_on_project_id_and_commit_sha ON ONLY p_generated_ref_commits USING btree (project_id, commit_sha); -CREATE UNIQUE INDEX p_knowledge_graph_replicas_namespace_id_and_zoekt_node_id ON ONLY p_knowledge_graph_replicas USING btree (knowledge_graph_enabled_namespace_id, zoekt_node_id, namespace_id); - CREATE INDEX package_name_index ON packages_packages USING btree (name); CREATE INDEX packages_packages_failed_verification ON packages_package_files USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); @@ -49191,8 +49076,6 @@ CREATE TRIGGER assign_p_ci_stages_id_trigger BEFORE INSERT ON p_ci_stages FOR EA CREATE TRIGGER assign_p_duo_workflows_checkpoints_id_trigger BEFORE INSERT ON p_duo_workflows_checkpoints FOR EACH ROW EXECUTE FUNCTION assign_p_duo_workflows_checkpoints_id_value(); -CREATE TRIGGER assign_p_knowledge_graph_tasks_id_trigger BEFORE INSERT ON p_knowledge_graph_tasks FOR EACH ROW EXECUTE FUNCTION assign_p_knowledge_graph_tasks_id_value(); - CREATE TRIGGER assign_zoekt_tasks_id_trigger BEFORE INSERT ON zoekt_tasks FOR EACH ROW EXECUTE FUNCTION assign_zoekt_tasks_id_value(); CREATE TRIGGER chat_names_loose_fk_trigger AFTER DELETE ON chat_names REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); @@ -49249,8 +49132,6 @@ CREATE TRIGGER p_ci_pipelines_loose_fk_trigger AFTER DELETE ON p_ci_pipelines RE CREATE TRIGGER p_ci_workloads_loose_fk_trigger AFTER DELETE ON p_ci_workloads REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records_override_table('p_ci_workloads'); -CREATE TRIGGER p_knowledge_graph_enabled_namespaces_loose_fk_trigger AFTER DELETE ON p_knowledge_graph_enabled_namespaces REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records_override_table('p_knowledge_graph_enabled_namespaces'); - CREATE TRIGGER packages_nuget_symbols_loose_fk_trigger AFTER DELETE ON packages_nuget_symbols REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); CREATE TRIGGER packages_package_files_loose_fk_trigger AFTER DELETE ON packages_package_files REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); @@ -53071,9 +52952,6 @@ ALTER TABLE ONLY duo_workflows_checkpoint_writes ALTER TABLE ONLY issuable_resource_links ADD CONSTRAINT fk_rails_3f0ec6b1cf FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; -ALTER TABLE p_knowledge_graph_replicas - ADD CONSTRAINT fk_rails_3f20642c2f FOREIGN KEY (zoekt_node_id) REFERENCES zoekt_nodes(id) ON DELETE CASCADE; - ALTER TABLE ONLY analytics_cycle_analytics_stage_aggregations ADD CONSTRAINT fk_rails_3f409802fc FOREIGN KEY (stage_id) REFERENCES analytics_cycle_analytics_group_stages(id) ON DELETE CASCADE; @@ -53623,9 +53501,6 @@ ALTER TABLE ONLY personal_access_token_last_used_ips ALTER TABLE ONLY clusters_kubernetes_namespaces ADD CONSTRAINT fk_rails_7e7688ecaf FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; -ALTER TABLE p_knowledge_graph_enabled_namespaces - ADD CONSTRAINT fk_rails_801c561c42 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; - ALTER TABLE ONLY security_policies ADD CONSTRAINT fk_rails_802ceea0c8 FOREIGN KEY (security_orchestration_policy_configuration_id) REFERENCES security_orchestration_policy_configurations(id) ON DELETE CASCADE; diff --git a/ee/app/models/search/zoekt/node.rb b/ee/app/models/search/zoekt/node.rb index f03c7295427241..94bea16d26a5d2 100644 --- a/ee/app/models/search/zoekt/node.rb +++ b/ee/app/models/search/zoekt/node.rb @@ -48,7 +48,7 @@ class Node < ApplicationRecord validates :schema_version, presence: true validate :valid_services - ignore_column :knowledge_graph_schema_version, remove_with: '18.8', remove_after: '2025-12-15' + ignore_column :knowledge_graph_schema_version, remove_with: '18.9', remove_after: '2026-01-15' attribute :metadata, ::Gitlab::Database::Type::IndifferentJsonb.new # for indifferent access -- GitLab