Files
ubicloud/migrate/20231227_add_minio_pool_vm_size.rb
Furkan Sahin 14812bf91e Fix minio_pool vm_size column related migration
This caused an issue during deployment since there is an active minio
pool entity that does not have the vm_size column, yet. The new column
addition did not allow vm_size column to be null without providing a
default value. Now, we first create the column, set a value and then set
the not_null constraint.
2024-01-09 11:33:58 +01:00

24 lines
394 B
Ruby

# frozen_string_literal: true
Sequel.migration do
up do
alter_table(:minio_pool) do
add_column :vm_size, :text, collate: '"C"'
end
run <<~SQL
UPDATE minio_pool SET vm_size = 'standard-2';
SQL
alter_table(:minio_pool) do
set_column_not_null :vm_size
end
end
down do
alter_table(:minio_pool) do
drop_column :vm_size
end
end
end