meta_history.sql 1.3 KB

123456789101112131415161718192021
  1. CREATE TABLE IF NOT EXISTS `meta_history` (
  2. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  3. `gmt_create` datetime NOT NULL COMMENT '创建时间',
  4. `gmt_modified` datetime NOT NULL COMMENT '修改时间',
  5. `destination` varchar(128) DEFAULT NULL COMMENT '通道名称',
  6. `binlog_file` varchar(64) DEFAULT NULL COMMENT 'binlog文件名',
  7. `binlog_offest` bigint(20) DEFAULT NULL COMMENT 'binlog偏移量',
  8. `binlog_master_id` varchar(64) DEFAULT NULL COMMENT 'binlog节点id',
  9. `binlog_timestamp` bigint(20) DEFAULT NULL COMMENT 'binlog应用的时间戳',
  10. `use_schema` varchar(1024) DEFAULT NULL COMMENT '执行sql时对应的schema',
  11. `sql_schema` varchar(1024) DEFAULT NULL COMMENT '对应的schema',
  12. `sql_table` varchar(1024) DEFAULT NULL COMMENT '对应的table',
  13. `sql_text` longtext DEFAULT NULL COMMENT '执行的sql',
  14. `sql_type` varchar(256) DEFAULT NULL COMMENT 'sql类型',
  15. `extra` text DEFAULT NULL COMMENT '额外的扩展信息',
  16. PRIMARY KEY (`id`),
  17. UNIQUE KEY binlog_file_offest(`destination`,`binlog_master_id`,`binlog_file`,`binlog_offest`),
  18. KEY `destination` (`destination`),
  19. KEY `destination_timestamp` (`destination`,`binlog_timestamp`),
  20. KEY `gmt_modified` (`gmt_modified`)
  21. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='表结构变化明细表';