diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
commit | 5afcbe03ead9ada87621888a31a62652b10a7e4f (patch) | |
tree | 9918b67a0d0f0bafa6542e839a8be37adf73102d /db/migrate/20230906100001_add_metadata_columns_to_packages_py_pi_metadata.rb | |
parent | c97c0201564848c1f53226fe19d71fdcc472f7d0 (diff) |
Add latest changes from gitlab-org/gitlab@16-4-stable-eev16.4.0-rc42
Diffstat (limited to 'db/migrate/20230906100001_add_metadata_columns_to_packages_py_pi_metadata.rb')
-rw-r--r-- | db/migrate/20230906100001_add_metadata_columns_to_packages_py_pi_metadata.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/db/migrate/20230906100001_add_metadata_columns_to_packages_py_pi_metadata.rb b/db/migrate/20230906100001_add_metadata_columns_to_packages_py_pi_metadata.rb new file mode 100644 index 00000000000..4cbc0a5bf3e --- /dev/null +++ b/db/migrate/20230906100001_add_metadata_columns_to_packages_py_pi_metadata.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +class AddMetadataColumnsToPackagesPyPiMetadata < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + add_column :packages_pypi_metadata, :metadata_version, :text, null: true, if_not_exists: true + add_column :packages_pypi_metadata, :summary, :text, null: true, if_not_exists: true + add_column :packages_pypi_metadata, :keywords, :text, null: true, if_not_exists: true + add_column :packages_pypi_metadata, :author_email, :text, null: true, if_not_exists: true + add_column :packages_pypi_metadata, :description, :text, null: true, if_not_exists: true + add_column :packages_pypi_metadata, :description_content_type, :text, null: true, if_not_exists: true + end + + add_text_limit :packages_pypi_metadata, :metadata_version, 16 + add_text_limit :packages_pypi_metadata, :summary, 255 + add_text_limit :packages_pypi_metadata, :keywords, 255 + add_text_limit :packages_pypi_metadata, :author_email, 2048 + add_text_limit :packages_pypi_metadata, :description, 4000 + add_text_limit :packages_pypi_metadata, :description_content_type, 128 + end + + def down + with_lock_retries do + remove_column :packages_pypi_metadata, :metadata_version, if_exists: true + remove_column :packages_pypi_metadata, :summary, if_exists: true + remove_column :packages_pypi_metadata, :keywords, if_exists: true + remove_column :packages_pypi_metadata, :author_email, if_exists: true + remove_column :packages_pypi_metadata, :description, if_exists: true + remove_column :packages_pypi_metadata, :description_content_type, if_exists: true + end + end +end |