BEGIN;

INSERT INTO version_history (component, from_version, to_version, author)
VALUES ('HYPERFOCUS', 0, 1, 'Initial Creation');

CREATE TABLE hyperfocused(
  profileid INTEGER PRIMARY KEY REFERENCES user_profiles(profileid) ON DELETE CASCADE ON UPDATE CASCADE,
  started_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
  ends_at TIMSTAMPTZ NOT NULL,
  started_in INTEGER REFERENCES communities(communityid) ON DELETE SET NULL ON UPDATE CASCADE
);

COMMIT;
