-- Table holding domains to be processed by the NDP in order to figure out whether to add them to
-- be crawled.

CREATE TABLE IF NOT EXISTS NDP_NEW_DOMAINS(
    DOMAIN_ID INT NOT NULL PRIMARY KEY,
    STATE ENUM ('NEW', 'ACCEPTED', 'REJECTED') NOT NULL DEFAULT 'NEW',
    PRIORITY INT NOT NULL DEFAULT 0,
    TS_CHANGE TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    CHECK_COUNT INT NOT NULL DEFAULT 0
);

CREATE INDEX IF NOT EXISTS NDP_NEW_DOMAINS__STATE_PRIORITY ON NDP_NEW_DOMAINS (STATE, PRIORITY DESC);
