-- generated by export_tables.php on 2025-12-02 16:02:03
-- source: ip.sysfar.com.br/gtsyscon_gtsys -> table: gtsys_historicoitem

create table gtsys_historicoitem
(
  `codigo` int(11) NOT NULL AUTO_INCREMENT,
  `codigo_item` int(11) NOT NULL,
  `descricao` varchar(255) DEFAULT NULL,
  `data` date DEFAULT NULL,
  `hora` time DEFAULT NULL,
  `api` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`codigo`),
  CONSTRAINT `gtsys_historicoitem_ibfk_1` FOREIGN KEY (`codigo_item`) REFERENCES `gtsys_itens` (`codigo`) ON DELETE CASCADE ON UPDATE CASCADE
)ENGINE=InnoDB AUTO_INCREMENT=82728 DEFAULT CHARSET=utf8;

create unique index idx_hist_codigo
    on gtsys_historicoitem (codigo);

create unique index idx_teste
    on gtsys_historicoitem (codigo,codigo_item);

create index idx_hist_codigo_item
    on gtsys_historicoitem (codigo_item);

