-- Run this once in phpMyAdmin (select the database, then SQL tab).
-- Some panels (PasarGuard included) return the subscription link as a
-- RELATIVE path (e.g. "/sub/xxxx") instead of a full URL. That's fine for
-- the panel's own API calls (which go through base_url — often a
-- Cloudflare Worker/relay), but a relative link is useless if shown to
-- the end user, since it's not a real address to open.
--
-- sub_domain is the REAL public domain of the panel (the one the end
-- user's VPN client connects to), used only to complete relative
-- subscription links. It is separate from base_url on purpose: base_url
-- might point at a relay (e.g. a Cloudflare Worker) used only for the
-- admin API, while sub_domain is what actually gets opened by clients.
-- NULL = fall back to base_url (old behaviour).
ALTER TABLE servers
    ADD COLUMN sub_domain VARCHAR(255) NULL AFTER base_url;
