Skip to content

Establish conventions for network resource primary keys in Nexus #3013

Open

Description

@internet-diglett

In the resources added in #2645, we have defined a switch port settings resource:

CREATE TABLE omicron.public.switch_port_settings (
    id UUID PRIMARY KEY,
    name STRING(63) NOT NULL,
    description STRING(512) NOT NULL,
    time_created TIMESTAMPTZ NOT NULL,
    time_modified TIMESTAMPTZ NOT NULL,
    time_deleted TIMESTAMPTZ
);

The actual settings are in their own tables, with a composite primary key like so:

CREATE TABLE omicron.public.switch_port_settings_bgp_peer_config (
    port_settings_id UUID,
    bgp_announce_set_id UUID NOT NULL,
    bgp_config_id UUID NOT NULL,
    interface_name TEXT,
    addr INET,

    PRIMARY KEY (port_settings_id, interface_name, addr)
);

A question raised during code review was whether or not the settings should also have their own id column (UUID) as the primary key, instead of a composite primary key. This issue was created for discussing this and tracking subsequent work if necessary.

Activity

  1. added
    networking
    on May 9, 2023
  2. added
    obsolete
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    networkingobsolete

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions