DROP INDEX IF EXISTS rev_idx;
DROP TABLE IF EXISTS cfg_schema;

CREATE TABLE cfg_schema(
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  revision INTEGER NOT NULL,
  node varchar(64) NOT NULL,
  applied_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX rev_idx ON cfg_schema(revision, node);
