feat(networks): add name field to networks
- Migration 0007: ALTER TABLE networks ADD COLUMN name TEXT NOT NULL DEFAULT '' - Network model, repository, and API updated to include name - Networks page: name input in the add form, Name column as first column in table - Delete modal now shows "Name (CIDR)" for clarity - Hosts page: network dropdowns now show network name instead of CIDR - Seeds updated with names (LAN, DMZ, Corporate, VPN) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,15 +7,14 @@
|
||||
|
||||
-- ── Networks ──────────────────────────────────────────────────────────────────
|
||||
|
||||
INSERT INTO networks (cidr) VALUES
|
||||
('192.168.1.0/24'),
|
||||
('192.168.10.0/24'),
|
||||
('10.0.0.0/8'),
|
||||
('172.16.0.0/16')
|
||||
INSERT INTO networks (name, cidr) VALUES
|
||||
('LAN', '192.168.1.0/24'),
|
||||
('DMZ', '192.168.10.0/24'),
|
||||
('Corporate', '10.0.0.0/8'),
|
||||
('VPN', '172.16.0.0/16')
|
||||
ON CONFLICT (cidr) DO NOTHING;
|
||||
|
||||
-- ── Hosts ─────────────────────────────────────────────────────────────────────
|
||||
-- Hosts have no UNIQUE constraint, so we guard with WHERE NOT EXISTS.
|
||||
|
||||
-- LAN — 192.168.1.0/24
|
||||
INSERT INTO hosts (name, ip, network_id)
|
||||
|
||||
Reference in New Issue
Block a user