-- Nutzungszaehler & Quotas je Tenant (LIC-03, siehe core-kanban/tickets/LIC-03.md).
CREATE TABLE usage_counters (
    tenant_id  UUID NOT NULL,
    metric     TEXT NOT NULL,
    value      BIGINT NOT NULL DEFAULT 0,
    updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    PRIMARY KEY (tenant_id, metric)
);

CREATE TABLE usage_quotas (
    tenant_id   UUID NOT NULL,
    metric      TEXT NOT NULL,
    limit_value BIGINT NOT NULL,
    PRIMARY KEY (tenant_id, metric)
);
