Files
ubicloud/model/load_balancers_vms.rb
Jeremy Evans 718370f4c9 Convert ResourceMethods to a plugin
Allow plugin to take an etc_type keyword argument for using the
TYPE_ETC ubid type, and remove the separate definitions in every
model that uses the TYPE_ETC ubid type.

This was the cleanest way to DRY things up.  You cannot extend
the models with a module to do this before including ResourceMethods,
because then ResourceMethods::ClassMethods will override it, and
you cannot extend the models with a module to do this after
including ResourceMethods, because the inclusion will not work
correctly due to the eager definition of @ubid_format.

Best reviewed without whitespace differences.
2025-06-04 04:55:45 +09:00

25 lines
847 B
Ruby

# frozen_string_literal: true
require_relative "../model"
class LoadBalancersVms < Sequel::Model
many_to_one :load_balancer
many_to_one :vm
plugin ResourceMethods
include HealthMonitorMethods
end
# Table: load_balancers_vms
# Columns:
# load_balancer_id | uuid | NOT NULL
# vm_id | uuid | NOT NULL
# id | uuid | PRIMARY KEY
# Indexes:
# load_balancers_vms_pkey | PRIMARY KEY btree (id)
# load_balancers_vms_vm_id_key | UNIQUE btree (vm_id)
# Foreign key constraints:
# load_balancers_vms_load_balancer_id_fkey | (load_balancer_id) REFERENCES load_balancer(id)
# load_balancers_vms_vm_id_fkey | (vm_id) REFERENCES vm(id)
# Referenced By:
# load_balancer_vm_port | load_balancer_vm_port_load_balancer_vm_id_fkey | (load_balancer_vm_id) REFERENCES load_balancers_vms(id) ON DELETE CASCADE