mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-11-28 00:20:26 +08:00
We are also removing the UNIQUE index on [load_balancer_port_id, load_balancer_vm_id] because we will have multiple of these rows per stack for dual stack load balancers. This is why we are adding a new index on [load_balancer_port_id, load_balancer_vm_id, stack].
18 lines
476 B
Ruby
18 lines
476 B
Ruby
# frozen_string_literal: true
|
|
|
|
Sequel.migration do
|
|
up do
|
|
alter_table(:load_balancer_vm_port) do
|
|
set_column_default :id, Sequel.lit("gen_random_ubid_uuid(55)") # UBID.to_base32_n("1q") => 55 ubid type
|
|
add_column :stack, :text, null: true
|
|
add_constraint(:stack_check, Sequel.lit("stack in ('ipv4', 'ipv6')"))
|
|
end
|
|
end
|
|
|
|
down do
|
|
alter_table(:load_balancer_vm_port) do
|
|
drop_column :stack
|
|
set_column_default :id, nil
|
|
end
|
|
end
|
|
end
|