Skip to content
代码片段 群组 项目
未验证 提交 3ba3e9b1 编辑于 作者: Gerardo Navarro's avatar Gerardo Navarro 提交者: GitLab
浏览文件

refactor: Drop col 'package_name_pattern_ilike_query' Part 2

This MR includes:
- Dropping the column 'package_name_pattern_ilike_query'
  because it this column is not needed anymore
- Changes for the 2nd part for dropping a column based
  on the GitLab guide, see
  https://docs.gitlab.com/ee/development/database/avoiding_downtime_in_migrations.html#dropping-columns
- Changes relevant for protected packages

Changelog: removed
上级 7a10efc3
No related branches found
No related tags found
无相关合并请求
# frozen_string_literal: true
class RemovePackagesProtectionRulesPackageNamePatternIlikeQueryColumn < Gitlab::Database::Migration[2.2]
milestone '16.10'
disable_ddl_transaction!
def up
if column_exists?(
:packages_protection_rules, :package_name_pattern_ilike_query)
with_lock_retries do
remove_column :packages_protection_rules, :package_name_pattern_ilike_query
end
end
end
def down
with_lock_retries do
unless column_exists?(
:packages_protection_rules, :package_name_pattern_ilike_query)
add_column :packages_protection_rules, :package_name_pattern_ilike_query, :text
end
end
add_text_limit :packages_protection_rules, :package_name_pattern_ilike_query, 255
end
end
f593130e4ff94eab9e0881ff92b21c3d5c133a8ad513d8af49e2fe7e722b95d8
\ No newline at end of file
...@@ -12707,9 +12707,7 @@ CREATE TABLE packages_protection_rules ( ...@@ -12707,9 +12707,7 @@ CREATE TABLE packages_protection_rules (
push_protected_up_to_access_level smallint NOT NULL, push_protected_up_to_access_level smallint NOT NULL,
package_type smallint NOT NULL, package_type smallint NOT NULL,
package_name_pattern text NOT NULL, package_name_pattern text NOT NULL,
package_name_pattern_ilike_query text, CONSTRAINT check_d2d75d206d CHECK ((char_length(package_name_pattern) <= 255))
CONSTRAINT check_d2d75d206d CHECK ((char_length(package_name_pattern) <= 255)),
CONSTRAINT check_ff47b09794 CHECK ((char_length(package_name_pattern_ilike_query) <= 255))
); );
   
CREATE SEQUENCE packages_protection_rules_id_seq CREATE SEQUENCE packages_protection_rules_id_seq
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册