CREATE TABLE wireguard_peers (
    id UUID PRIMARY KEY,
    router_id UUID NOT NULL UNIQUE,
    public_key VARCHAR(255) NOT NULL UNIQUE,
    vpn_ip VARCHAR(45) NOT NULL,
    allowed_ips VARCHAR(100) NOT NULL,
    endpoint_mode VARCHAR(50) NOT NULL,
    status VARCHAR(50) NOT NULL,
    created_at TIMESTAMP NOT NULL,
    updated_at TIMESTAMP NOT NULL,

    CONSTRAINT fk_wireguard_peers_router
        FOREIGN KEY (router_id)
        REFERENCES routers(id)
);

CREATE INDEX idx_wireguard_peers_status
    ON wireguard_peers(status);