V20260621_01__lobster_binding_exec_stats.sql 873 B

12345678910111213141516
  1. -- Master DB: company_tag_binding_exec_stats (defensive, tenant DB is primary)
  2. CREATE TABLE IF NOT EXISTS `company_tag_binding_exec_stats` (
  3. `id` BIGINT NOT NULL AUTO_INCREMENT,
  4. `company_id` BIGINT NOT NULL COMMENT 'company id',
  5. `binding_id` BIGINT NOT NULL COMMENT 'binding id',
  6. `rel_count` INT NOT NULL DEFAULT 0,
  7. `task_pending` INT NOT NULL DEFAULT 0,
  8. `instance_running` INT NOT NULL DEFAULT 0,
  9. `stat_time` DATETIME NOT NULL,
  10. `create_time` DATETIME NULL,
  11. `update_time` DATETIME NULL,
  12. PRIMARY KEY (`id`),
  13. UNIQUE KEY `uk_company_binding` (`company_id`, `binding_id`),
  14. KEY `idx_company_stat_time` (`company_id`, `stat_time`)
  15. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='tag binding execution stats';