console/src/main/resources/META-INF/derby-schema.sql [102:222]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CREATE TABLE config_info_gray (
   id bigint NOT NULL generated by default as identity,
   data_id varchar(255) NOT NULL,
   group_id varchar(128) NOT NULL,
   tenant_id varchar(128) default '',
   gray_name varchar(128) NOT NULL,
   gray_rule CLOB,
   app_name varchar(128),
   src_ip varchar(128),
   src_user varchar(128) default '',
   content CLOB,
   md5 varchar(32) DEFAULT NULL,
   encrypted_data_key varchar(32) DEFAULT NULL,
   gmt_create timestamp NOT NULL DEFAULT '2010-05-05 00:00:00',
   gmt_modified timestamp NOT NULL DEFAULT '2010-05-05 00:00:00',
   constraint configinfogray_id_key PRIMARY KEY (id),
   constraint uk_configinfogray_datagrouptenantgrayname UNIQUE (data_id,group_id,tenant_id,gray_name));
CREATE INDEX config_info_gray_dataid_gmt_modified ON config_info_gray(data_id,gmt_modified);
CREATE INDEX config_info_gray_gmt_modified ON config_info_gray(gmt_modified);

CREATE TABLE app_list (
 id bigint NOT NULL generated by default as identity,
 app_name varchar(128) NOT NULL,
 is_dynamic_collect_disabled smallint DEFAULT 0,
 last_sub_info_collected_time timestamp DEFAULT '1970-01-01 08:00:00.0',
 sub_info_lock_owner varchar(128),
 sub_info_lock_time timestamp DEFAULT '1970-01-01 08:00:00.0',
 constraint applist_id_key PRIMARY KEY (id),
 constraint uk_appname UNIQUE (app_name));

CREATE TABLE app_configdata_relation_subs (
  id bigint NOT NULL generated by default as identity,
  app_name varchar(128) NOT NULL,
  data_id varchar(255) NOT NULL,
  group_id varchar(128) NOT NULL,
  gmt_modified timestamp DEFAULT '2010-05-05 00:00:00',
  constraint configdatarelationsubs_id_key PRIMARY KEY (id),
  constraint uk_app_sub_config_datagroup UNIQUE (app_name, data_id, group_id));


CREATE TABLE app_configdata_relation_pubs (
  id bigint NOT NULL generated by default as identity,
  app_name varchar(128) NOT NULL,
  data_id varchar(255) NOT NULL,
  group_id varchar(128) NOT NULL,
  gmt_modified timestamp DEFAULT '2010-05-05 00:00:00',
  constraint configdatarelationpubs_id_key PRIMARY KEY (id),
  constraint uk_app_pub_config_datagroup UNIQUE (app_name, data_id, group_id));

CREATE TABLE config_tags_relation (
  id bigint NOT NULL,
  tag_name varchar(128) NOT NULL,
  tag_type varchar(64) DEFAULT NULL,
  data_id varchar(255) NOT NULL,
  group_id varchar(128) NOT NULL,
  tenant_id varchar(128) DEFAULT '',
  nid bigint NOT NULL generated by default as identity,
  constraint config_tags_id_key PRIMARY KEY (nid),
  constraint uk_configtagrelation_configidtag UNIQUE (id, tag_name, tag_type));

CREATE INDEX config_tags_tenant_id_idx ON config_tags_relation(tenant_id);

CREATE TABLE group_capacity (
  id bigint NOT NULL generated by default as identity,
  group_id varchar(128) DEFAULT '',
  quota int DEFAULT 0,
  usage int DEFAULT 0,
  max_size int DEFAULT 0,
  max_aggr_count int DEFAULT 0,
  max_aggr_size int DEFAULT 0,
  max_history_count int DEFAULT 0,
  gmt_create timestamp DEFAULT '2010-05-05 00:00:00',
  gmt_modified timestamp DEFAULT '2010-05-05 00:00:00',
  constraint group_capacity_id_key PRIMARY KEY (id),
  constraint uk_group_id UNIQUE (group_id));

CREATE TABLE tenant_capacity (
  id bigint NOT NULL generated by default as identity,
  tenant_id varchar(128) DEFAULT '',
  quota int DEFAULT 0,
  usage int DEFAULT 0,
  max_size int DEFAULT 0,
  max_aggr_count int DEFAULT 0,
  max_aggr_size int DEFAULT 0,
  max_history_count int DEFAULT 0,
  gmt_create timestamp DEFAULT '2010-05-05 00:00:00',
  gmt_modified timestamp DEFAULT '2010-05-05 00:00:00',
  constraint tenant_capacity_id_key PRIMARY KEY (id),
  constraint uk_tenant_id UNIQUE (tenant_id));

CREATE TABLE tenant_info (
  id bigint NOT NULL generated by default as identity,
  kp varchar(128) NOT NULL,
  tenant_id varchar(128)  DEFAULT '',
  tenant_name varchar(128)  DEFAULT '',
  tenant_desc varchar(256)  DEFAULT NULL,
  create_source varchar(32) DEFAULT NULL,
  gmt_create bigint NOT NULL,
  gmt_modified bigint NOT NULL,
  constraint tenant_info_id_key PRIMARY KEY (id),
  constraint uk_tenant_info_kptenantid UNIQUE (kp,tenant_id));
CREATE INDEX tenant_info_tenant_id_idx ON tenant_info(tenant_id);

CREATE TABLE users (
	username varchar(50) NOT NULL PRIMARY KEY,
	password varchar(500) NOT NULL,
	enabled boolean NOT NULL DEFAULT true
);

CREATE TABLE roles (
	username varchar(50) NOT NULL,
	role varchar(50) NOT NULL,
	constraint uk_username_role UNIQUE (username,role)
);

CREATE TABLE permissions (
    role varchar(50) NOT NULL,
    resource varchar(512) NOT NULL,
    action varchar(8) NOT NULL,
    constraint uk_role_permission UNIQUE (role,resource,action)
);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



distribution/conf/derby-schema.sql [68:188]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CREATE TABLE config_info_gray (
                                  id bigint NOT NULL generated by default as identity,
                                  data_id varchar(255) NOT NULL,
                                  group_id varchar(128) NOT NULL,
                                  tenant_id varchar(128) default '',
                                  gray_name varchar(128) NOT NULL,
                                  gray_rule CLOB,
                                  app_name varchar(128),
                                  src_ip varchar(128),
                                  src_user varchar(128) default '',
                                  content CLOB,
                                  md5 varchar(32) DEFAULT NULL,
                                  encrypted_data_key varchar(32) DEFAULT NULL,
                                  gmt_create timestamp NOT NULL DEFAULT '2010-05-05 00:00:00',
                                  gmt_modified timestamp NOT NULL DEFAULT '2010-05-05 00:00:00',
                                  constraint configinfogray_id_key PRIMARY KEY (id),
                                  constraint uk_configinfogray_datagrouptenantgrayname UNIQUE (data_id,group_id,tenant_id,gray_name));
CREATE INDEX config_info_gray_dataid_gmt_modified ON config_info_gray(data_id,gmt_modified);
CREATE INDEX config_info_gray_gmt_modified ON config_info_gray(gmt_modified);

CREATE TABLE app_list (
                          id bigint NOT NULL generated by default as identity,
                          app_name varchar(128) NOT NULL,
                          is_dynamic_collect_disabled smallint DEFAULT 0,
                          last_sub_info_collected_time timestamp DEFAULT '1970-01-01 08:00:00.0',
                          sub_info_lock_owner varchar(128),
                          sub_info_lock_time timestamp DEFAULT '1970-01-01 08:00:00.0',
                          constraint applist_id_key PRIMARY KEY (id),
                          constraint uk_appname UNIQUE (app_name));

CREATE TABLE app_configdata_relation_subs (
                                              id bigint NOT NULL generated by default as identity,
                                              app_name varchar(128) NOT NULL,
                                              data_id varchar(255) NOT NULL,
                                              group_id varchar(128) NOT NULL,
                                              gmt_modified timestamp DEFAULT '2010-05-05 00:00:00',
                                              constraint configdatarelationsubs_id_key PRIMARY KEY (id),
                                              constraint uk_app_sub_config_datagroup UNIQUE (app_name, data_id, group_id));


CREATE TABLE app_configdata_relation_pubs (
                                              id bigint NOT NULL generated by default as identity,
                                              app_name varchar(128) NOT NULL,
                                              data_id varchar(255) NOT NULL,
                                              group_id varchar(128) NOT NULL,
                                              gmt_modified timestamp DEFAULT '2010-05-05 00:00:00',
                                              constraint configdatarelationpubs_id_key PRIMARY KEY (id),
                                              constraint uk_app_pub_config_datagroup UNIQUE (app_name, data_id, group_id));

CREATE TABLE config_tags_relation (
                                      id bigint NOT NULL,
                                      tag_name varchar(128) NOT NULL,
                                      tag_type varchar(64) DEFAULT NULL,
                                      data_id varchar(255) NOT NULL,
                                      group_id varchar(128) NOT NULL,
                                      tenant_id varchar(128) DEFAULT '',
                                      nid bigint NOT NULL generated by default as identity,
                                      constraint config_tags_id_key PRIMARY KEY (nid),
                                      constraint uk_configtagrelation_configidtag UNIQUE (id, tag_name, tag_type));

CREATE INDEX config_tags_tenant_id_idx ON config_tags_relation(tenant_id);

CREATE TABLE group_capacity (
                                id bigint NOT NULL generated by default as identity,
                                group_id varchar(128) DEFAULT '',
                                quota int DEFAULT 0,
                                usage int DEFAULT 0,
                                max_size int DEFAULT 0,
                                max_aggr_count int DEFAULT 0,
                                max_aggr_size int DEFAULT 0,
                                max_history_count int DEFAULT 0,
                                gmt_create timestamp DEFAULT '2010-05-05 00:00:00',
                                gmt_modified timestamp DEFAULT '2010-05-05 00:00:00',
                                constraint group_capacity_id_key PRIMARY KEY (id),
                                constraint uk_group_id UNIQUE (group_id));

CREATE TABLE tenant_capacity (
                                 id bigint NOT NULL generated by default as identity,
                                 tenant_id varchar(128) DEFAULT '',
                                 quota int DEFAULT 0,
                                 usage int DEFAULT 0,
                                 max_size int DEFAULT 0,
                                 max_aggr_count int DEFAULT 0,
                                 max_aggr_size int DEFAULT 0,
                                 max_history_count int DEFAULT 0,
                                 gmt_create timestamp DEFAULT '2010-05-05 00:00:00',
                                 gmt_modified timestamp DEFAULT '2010-05-05 00:00:00',
                                 constraint tenant_capacity_id_key PRIMARY KEY (id),
                                 constraint uk_tenant_id UNIQUE (tenant_id));

CREATE TABLE tenant_info (
                             id bigint NOT NULL generated by default as identity,
                             kp varchar(128) NOT NULL,
                             tenant_id varchar(128)  DEFAULT '',
                             tenant_name varchar(128)  DEFAULT '',
                             tenant_desc varchar(256)  DEFAULT NULL,
                             create_source varchar(32) DEFAULT NULL,
                             gmt_create bigint NOT NULL,
                             gmt_modified bigint NOT NULL,
                             constraint tenant_info_id_key PRIMARY KEY (id),
                             constraint uk_tenant_info_kptenantid UNIQUE (kp,tenant_id));
CREATE INDEX tenant_info_tenant_id_idx ON tenant_info(tenant_id);

CREATE TABLE users (
                       username varchar(50) NOT NULL PRIMARY KEY,
                       password varchar(500) NOT NULL,
                       enabled boolean NOT NULL DEFAULT true
);

CREATE TABLE roles (
                       username varchar(50) NOT NULL,
                       role varchar(50) NOT NULL,
                       constraint uk_username_role UNIQUE (username,role)
);

CREATE TABLE permissions (
                             role varchar(50) NOT NULL,
                             resource varchar(512) NOT NULL,
                             action varchar(8) NOT NULL,
                             constraint uk_role_permission UNIQUE (role,resource,action)
);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



