Files
ubicloud/migrate/20250325_remove_old_load_balancer_fields.rb
mohi-kalantari 311bc9508e Drop old fields from loadbalancer resources
State field from LoadBalancersVms and src_port/dst_port from LoadBalancer
are dropped in favor of the new design. Instead LoadBalancerVmPort will hold
the actial state and port info is moved to the LoadBalancerPort model.
2025-03-25 11:02:41 +01:00

26 lines
482 B
Ruby

# frozen_string_literal: true
Sequel.migration do
up do
alter_table(:load_balancer) do
drop_column :src_port
drop_column :dst_port
end
alter_table(:load_balancers_vms) do
drop_column :state
end
end
down do
alter_table(:load_balancer) do
add_column :src_port, :integer
add_column :dst_port, :integer
end
alter_table(:load_balancers_vms) do
add_column :state, :lb_node_state, default: "down"
end
end
end