diff options
Diffstat (limited to 'db/migrate/20200901214416_change_pypi_python_version_type.rb')
-rw-r--r-- | db/migrate/20200901214416_change_pypi_python_version_type.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20200901214416_change_pypi_python_version_type.rb b/db/migrate/20200901214416_change_pypi_python_version_type.rb new file mode 100644 index 00000000000..b670b2129c2 --- /dev/null +++ b/db/migrate/20200901214416_change_pypi_python_version_type.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class ChangePypiPythonVersionType < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + change_column_type_concurrently :packages_pypi_metadata, :required_python, :text, batch_column_name: :package_id # rubocop:disable Migration/AddLimitToTextColumns + end + + def down + cleanup_concurrent_column_type_change(:packages_pypi_metadata, :required_python) + change_column_null :packages_pypi_metadata, :required_python, false + end +end |