diff --git a/db/post_migrate/20251014140356_remove_workspace_desired_config_generator_version_column.rb b/db/post_migrate/20251014140356_remove_workspace_desired_config_generator_version_column.rb new file mode 100644 index 0000000000000000000000000000000000000000..d4e58da492222b5935102c740e344d18f6c565c7 --- /dev/null +++ b/db/post_migrate/20251014140356_remove_workspace_desired_config_generator_version_column.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class RemoveWorkspaceDesiredConfigGeneratorVersionColumn < Gitlab::Database::Migration[2.3] + disable_ddl_transaction! + milestone '18.6' + + def up + remove_column :workspaces, :desired_config_generator_version, if_exists: true + end + + def down + add_column :workspaces, :desired_config_generator_version, :integer, default: 3, if_not_exists: true + add_concurrent_index( + :workspaces, + :id, + where: "desired_config_generator_version IS NULL", + name: "idx_workspaces_null_config_version_id" + ) + end +end diff --git a/db/schema_migrations/20251014140356 b/db/schema_migrations/20251014140356 new file mode 100644 index 0000000000000000000000000000000000000000..4c3f0fb96196cdf23ee0799931afd5e2b5940b07 --- /dev/null +++ b/db/schema_migrations/20251014140356 @@ -0,0 +1 @@ +a459ee0d2bfd8f3b66a430d9411867f476832a646bd3a2459472e6075644b0fd \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 493aecdd6d88ae010f896f299eb6a5ee3f073626..9f400f08431a18f1e0db36169897a52c87e10376 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -29469,7 +29469,6 @@ CREATE TABLE workspaces ( url_prefix text, url_query_string text, workspaces_agent_config_version integer NOT NULL, - desired_config_generator_version integer DEFAULT 3, project_ref text, actual_state_updated_at timestamp with time zone NOT NULL, CONSTRAINT check_15543fb0fa CHECK ((char_length(name) <= 64)), @@ -38386,8 +38385,6 @@ CREATE INDEX idx_wi_type_custom_lifecycles_on_work_item_type_id ON work_item_typ CREATE INDEX idx_workflows_status_updated_at_id ON duo_workflows_workflows USING btree (status, updated_at, id); -CREATE INDEX idx_workspaces_null_config_version_id ON workspaces USING btree (id) WHERE (desired_config_generator_version IS NULL); - CREATE INDEX idx_zoekt_last_indexed_at_gt_used_storage_bytes_updated_at ON zoekt_indices USING btree (used_storage_bytes_updated_at) WHERE (last_indexed_at >= used_storage_bytes_updated_at); CREATE INDEX idx_zoekt_repositories_on_zoekt_index_id_and_size_bytes ON zoekt_repositories USING btree (zoekt_index_id, size_bytes);