Skip to content
代码片段 群组 项目
提交 2d43b409 编辑于 作者: Chad Woolley's avatar Chad Woolley
浏览文件

Fix workspaces url_prefix field

- Fixes incorrect inclusion of protocol in
  db/migrate/20240106000000_migrate_data_from_workspaces_url_column.rb
- See https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17459

Changelog: other
EE: true
上级 f2e6ba19
No related branches found
No related tags found
无相关合并请求
...@@ -13,7 +13,7 @@ def up ...@@ -13,7 +13,7 @@ def up
each_batch_range('workspaces', scope: ->(table) { table.all }, of: BATCH_SIZE) do |min, max| each_batch_range('workspaces', scope: ->(table) { table.all }, of: BATCH_SIZE) do |min, max|
execute(<<~SQL) execute(<<~SQL)
UPDATE workspaces UPDATE workspaces
SET url_prefix = CONCAT('https://#{DEFAULT_PORT}-', name), SET url_prefix = CONCAT('#{DEFAULT_PORT}-', name),
dns_zone = remote_development_agent_configs.dns_zone, dns_zone = remote_development_agent_configs.dns_zone,
url_query_string = CASE url_query_string = CASE
WHEN POSITION('?' IN url) > 0 WHEN POSITION('?' IN url) > 0
......
# frozen_string_literal: true
class UpdateWorkspacesUrlPrefixColumn < Gitlab::Database::Migration[2.2]
milestone '16.8'
disable_ddl_transaction!
restrict_gitlab_migration gitlab_schema: :gitlab_main
def up
execute(<<~SQL)
UPDATE workspaces
SET url_prefix=REPLACE(url_prefix, 'https://', '')
WHERE url_prefix LIKE 'https://%'
SQL
end
def down
# no-op
end
end
554281098ec89db0f0bc0402e34c1fe413003afa63b0001da8d5ad772dd9725c
\ No newline at end of file
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册