diff --git a/src/lib/services/ports.service.ts b/src/lib/services/ports.service.ts index d9afc45a..34bde5de 100644 --- a/src/lib/services/ports.service.ts +++ b/src/lib/services/ports.service.ts @@ -11,7 +11,11 @@ import type { CreatePortInput, UpdatePortInput } from '@/lib/validators/ports'; import { ensureSystemRoots } from '@/lib/services/document-folders.service'; export async function listPorts() { - return db.select().from(ports).orderBy(ports.name); + // Creation order (oldest first), not alphabetical: the first-seeded port + // is the primary one (Port Nimara), so it leads the switcher and is the + // default a super-admin lands on. Alphabetical put "Port Amador" ahead of + // "Port Nimara". Name is a stable tiebreaker for same-instant inserts. + return db.select().from(ports).orderBy(ports.createdAt, ports.name); } export async function getPort(id: string) {