Files
ubicloud/model/connected_subnet.rb
Jeremy Evans e26412a41e Override Model.ubid_type before including ResourceMethods
This avoids an exception per class during class loading.

For FirewallsPrivateSubnets and CertsLoadBalancers, this defines
a ubid_type method when one was previously not defined.  This
method isn't used, since these models do not have an id field
currently.  I'm guessing these models only use ResourceMethods
for the before_destroy hook, so potentially, that could be moved
to a separate module, or we could use a trigger approach to
updating the archive table instead of a model hook approach.
2025-02-26 09:23:01 -08:00

27 lines
825 B
Ruby

# frozen_string_literal: true
require_relative "../model"
class ConnectedSubnet < Sequel::Model
def self.ubid_type
UBID::TYPE_ETC
end
include ResourceMethods
end
# Table: connected_subnet
# Columns:
# id | uuid | PRIMARY KEY
# subnet_id_1 | uuid | NOT NULL
# subnet_id_2 | uuid | NOT NULL
# Indexes:
# connected_subnet_pkey | PRIMARY KEY btree (id)
# connected_subnet_subnet_id_1_subnet_id_2_key | UNIQUE btree (subnet_id_1, subnet_id_2)
# connected_subnet_subnet_id_2_index | btree (subnet_id_2)
# Check constraints:
# unique_subnet_pair | (subnet_id_1 < subnet_id_2)
# Foreign key constraints:
# connected_subnet_subnet_id_1_fkey | (subnet_id_1) REFERENCES private_subnet(id)
# connected_subnet_subnet_id_2_fkey | (subnet_id_2) REFERENCES private_subnet(id)