-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Labels
cleanupCode cleanlinessCode cleanliness
Description
We have some tables with columns being foreign keys to potentially multiple tables depending on some kind or type, e.g.:
CREATE TYPE omicron.public.network_interface_kind AS ENUM (
/* An interface attached to a guest instance. */
'instance',
/* An interface attached to a service. */
'service'
);
CREATE TABLE omicron.public.network_interface (
/* ...snip... */
/* The kind of network interface, e.g., instance */
kind omicron.public.network_interface_kind NOT NULL,
/*
* FK into the parent resource of this interface (e.g. Instance, Service)
* as determined by the `kind`.
*/
parent_id UUID NOT NULL,Keeping track of 2 separate columns can be kind of fraught so it'd be nice to replace with a composite data type on the SQL side and an enum + appropriate impls on the Rust side.
Metadata
Metadata
Assignees
Labels
cleanupCode cleanlinessCode cleanliness