/*
 * Copyright ©  2022 Thomas J Collinson
 * All rights reserved
 */

DROP TABLE `ghost_secret_cache`;

CREATE TABLE `ghost_secret_cache`
(
    `dispatch_idfk` INT UNSIGNED     NOT NULL PRIMARY KEY,
    `url`           VARCHAR(150)     NOT NULL,
    `secret`        VARCHAR(500)     NOT NULL,
    `expires`       BIGINT DEFAULT 0 NOT NULL,
    CONSTRAINT `ghost_secret_cache_ibfk_1` FOREIGN KEY (`dispatch_idfk`) REFERENCES `dispatch_systems` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
);

ALTER TABLE `invoice_accounts`
    MODIFY `identifier` VARCHAR(100) NOT NULL;