START TRANSACTION;

CREATE TABLE IF NOT EXISTS resource_mapping
(
    request_resource_id BIGINT NOT NULL REFERENCES resource (id) ON UPDATE CASCADE ON DELETE CASCADE,
    quota_resource_key short_text NOT NULL,
    service_key short_text NOT NULL,
    UNIQUE (request_resource_id)
);

COMMENT ON TABLE resource_mapping IS 'Table for mapping resources from quota requests to external resources on other clusters';

COMMIT;