Files
Homelab-manager/server/drizzle/0080_lazy_iron_fist.sql
bobbanandClaude Sonnet 5.5 9ca83994fb Name ports after the Docker containers that publish them
The health pass keeps the host ports Dockhand says running containers
publish (new table server_container_ports, migration 0080), matched to a
server by its Docker host's name. They name the port on the server's Ports
card and the network Ports table, ahead of a port preset and behind a
label somebody wrote, and in the new-port alert ("8096/tcp jellyfin
(container)"). Never written onto port notes, so a container's port is
still a new port; an unreadable host keeps its names, a day-old name is
dropped. Dockhand is now read on the health pass even with container
alerts off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-31 22:45:50 +01:00

12 lines
512 B
SQL

CREATE TABLE `server_container_ports` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`server_id` integer NOT NULL,
`port` integer NOT NULL,
`protocol` text DEFAULT 'tcp' NOT NULL,
`container` text NOT NULL,
`image` text DEFAULT '' NOT NULL,
`updated_at` text NOT NULL,
FOREIGN KEY (`server_id`) REFERENCES `servers`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `server_container_ports_unique` ON `server_container_ports` (`server_id`,`port`,`protocol`);