Add customer domain Traefik routing

This commit is contained in:
Hermes Agent
2026-09-22 12:18:22 +00:00
parent d36a72f421
commit 4476af5aab
5 changed files with 54 additions and 5 deletions
@@ -0,0 +1,4 @@
-- Add an optional customer-owned domain for Traefik routing.
ALTER TABLE instances
ADD COLUMN IF NOT EXISTS custom_domain VARCHAR(253) NULL AFTER name,
ADD UNIQUE KEY IF NOT EXISTS uq_instances_custom_domain (custom_domain);
+2
View File
@@ -71,6 +71,7 @@ CREATE TABLE IF NOT EXISTS instances (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
owner_user_id BIGINT UNSIGNED NOT NULL,
name VARCHAR(120) NOT NULL,
custom_domain VARCHAR(253) NULL,
plan ENUM('s', 'm', 'l') NOT NULL DEFAULT 's',
billing_period ENUM('monthly', 'yearly') NOT NULL DEFAULT 'monthly',
price_gross_cents INT UNSIGNED NOT NULL DEFAULT 0,
@@ -91,6 +92,7 @@ CREATE TABLE IF NOT EXISTS instances (
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id),
UNIQUE KEY uq_instances_container_name (container_name),
UNIQUE KEY uq_instances_custom_domain (custom_domain),
UNIQUE KEY uq_instances_port (port),
CONSTRAINT fk_instances_owner FOREIGN KEY (owner_user_id) REFERENCES users (id)
ON UPDATE CASCADE ON DELETE RESTRICT