BEGIN;

CREATE TABLE network_message_usage (
  network_id    TEXT        NOT NULL REFERENCES networks(id) ON DELETE CASCADE,
  usage_date    DATE        NOT NULL,
  message_count INTEGER     NOT NULL DEFAULT 0,
  updated_at    TIMESTAMPTZ NOT NULL DEFAULT NOW(),
  PRIMARY KEY (network_id, usage_date)
);

COMMIT;
