CREATE TABLE softsat_locacao_checklist (
    id INTEGER PRIMARY KEY AUTO_INCREMENT,
	`created_on` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`updated_on` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
	`created_by` INT(11) NULL DEFAULT NULL,
	`updated_by` INT(11) NULL DEFAULT NULL,
    descricao VARCHAR(255) NOT NULL,
    ativo INTEGER NOT NULL,
	CONSTRAINT `fk_softsat_locacao_checklist_hwapx_user_created_by` FOREIGN KEY (`created_by`) REFERENCES `hwapx_user` (`id`) ON DELETE SET NULL,
	CONSTRAINT `fk_softsat_locacao_checklist_hwapx_user_updated_by` FOREIGN KEY (`updated_by`) REFERENCES `hwapx_user` (`id`) ON DELETE SET NULL
);

CREATE TABLE softsat_locacao_contrato_checklist (
    id INTEGER PRIMARY KEY AUTO_INCREMENT,
	`created_on` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`updated_on` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
	`created_by` INT(11) NULL DEFAULT NULL,
	`updated_by` INT(11) NULL DEFAULT NULL,
    contrato_id INTEGER NOT NULL,
    checklist_id INTEGER NOT NULL,
    descricao VARCHAR(255) NOT NULL,
    ok INTEGER NOT NULL,
	CONSTRAINT `fk_softsat_locacao_contrato_checklist_hwapx_user_created_by` FOREIGN KEY (`created_by`) REFERENCES `hwapx_user` (`id`) ON DELETE SET NULL,
	CONSTRAINT `fk_softsat_locacao_contrato_checklist_hwapx_user_updated_by` FOREIGN KEY (`updated_by`) REFERENCES `hwapx_user` (`id`) ON DELETE SET NULL
);