Table sub_mapping has more than one primary key, you say? Ok, you might be on to something.

CREATE TABLE sub_mapping (
    subscription_id TEXT PRIMARY KEY,
    customer_id TEXT PRIMARY KEY,
    local_subscription_id TEXT PRIMARY KEY,
    user_id TEXT PRIMARY KEY
);