This makes it easier for developers new to the codebase to easily get important information on the model's table in the same file as the model code. To ensure the model annotations stay accurate, run them on test_up/test_down. In CI, regenerate the annotations, and check for no changes, similar to how the linters work.
27 lines
825 B
Ruby
27 lines
825 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "../model"
|
|
|
|
class ConnectedSubnet < Sequel::Model
|
|
include ResourceMethods
|
|
|
|
def self.ubid_type
|
|
UBID::TYPE_ETC
|
|
end
|
|
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)
|