sj_server_node.sql 1.5 KB

12345678910111213141516171819202122232425
  1. create table sj_server_node
  2. (
  3. id bigint unsigned auto_increment comment '主键'
  4. primary key,
  5. namespace_id varchar(64) default '764d604ec6fc45f68cd92514c40e9e1a' not null comment '命名空间id',
  6. group_name varchar(64) not null comment '组名称',
  7. host_id varchar(64) not null comment '主机id',
  8. host_ip varchar(64) not null comment '机器ip',
  9. host_port int not null comment '机器端口',
  10. expire_at datetime not null comment '过期时间',
  11. node_type tinyint not null comment '节点类型 1、客户端 2、是服务端',
  12. ext_attrs varchar(256) default '' null comment '扩展字段',
  13. create_dt datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  14. update_dt datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间',
  15. constraint uk_host_id_host_ip
  16. unique (host_id, host_ip)
  17. )
  18. comment '服务器节点';
  19. create index idx_expire_at_node_type
  20. on sj_server_node (expire_at, node_type);
  21. create index idx_namespace_id_group_name
  22. on sj_server_node (namespace_id, group_name);