diff options
Diffstat (limited to 'db/migrate/20230701195315_add_kubernetes_namespace_column_to_environments.rb')
-rw-r--r-- | db/migrate/20230701195315_add_kubernetes_namespace_column_to_environments.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20230701195315_add_kubernetes_namespace_column_to_environments.rb b/db/migrate/20230701195315_add_kubernetes_namespace_column_to_environments.rb new file mode 100644 index 00000000000..e05feca2c64 --- /dev/null +++ b/db/migrate/20230701195315_add_kubernetes_namespace_column_to_environments.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddKubernetesNamespaceColumnToEnvironments < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + add_column :environments, :kubernetes_namespace, :text unless column_exists?(:environments, :kubernetes_namespace) + end + + add_text_limit :environments, :kubernetes_namespace, 63 + end + + def down + remove_column :environments, :kubernetes_namespace + end +end |