适配Nacos2.4.1 达梦数据库DM8版本

2024-08-22 04:12

本文主要是介绍适配Nacos2.4.1 达梦数据库DM8版本,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

目前已经适配2.4.1版本

若需要直接使用可以下载是适配后源码进行编译
https://gogs.zyjblogs.cn/zhuyijun/nacos
若需要看适配过程可参阅下面适配操作

安装达梦驱动到本地仓库

mvn install:install-file -Dfile=DmJdbcDriver-1.8.jar -DgroupId=dm.jdbc -DartifactId=DmJdbcDriver  -Dversion=1.8 -Dpackaging=jar

引用DM驱动

  1. nacos-all的pom.xml文件添加
<properties><dm-jdbc.version>1.8</dm-jdbc.version>  
</properties><dependencies>
<dependency>  <groupId>dm.jdbc</groupId>  <artifactId>DmJdbcDriver</artifactId>  <version>${dm-jdbc.version}</version>  
</dependency>
</dependencies>
  1. nacos-common、nacos-naming、nacos-config工程的pom.xml文件添加
<dependencies>
<dependency>  <groupId>dm.jdbc</groupId>  <artifactId>DmJdbcDriver</artifactId>  <version>${dm-jdbc.version}</version>  
</dependency>
</dependencies>

修改代码

DataSourceConstant 数据源常量修改

class: com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant
添加 public static final String DM = “dm”;

public class DataSourceConstant {  public static final String MYSQL = "mysql";  public static final String DERBY = "derby";  public static final String DM = "dm";  
}

修改Mapper

目录: com.alibaba.nacos.plugin.datasource.impl
1、复制com.alibaba.nacos.plugin.datasource.impl.mysql -> com.alibaba.nacos.plugin.datasource.impl.dm
2、修改mapper中的getDataSource方法,改为DataSourceConstant.DM

image.png

修改resoure

datasource(nacos-datasource-plugin)工程 resources目录下的META-INF/services/com.alibaba.nacos.plugin.datasource.mapper.Mapper

com.alibaba.nacos.plugin.datasource.impl.dm.ConfigInfoAggrMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.ConfigInfoBetaMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.ConfigInfoMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.ConfigInfoTagMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.ConfigTagsRelationMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.HistoryConfigInfoMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.TenantInfoMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.TenantCapacityMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.GroupCapacityMapperByDm

image.png

添加DM程序适配器

PersistenceConstant添加

class: com.alibaba.nacos.persistence.constants.PersistenceConstant

public static final String DM = "dm";

image.png

添加DM分页适配器

目录: com.alibaba.nacos.plugin.auth.impl.persistence.handler.support
该目录下添加DM适配器类

public class DmPageHandlerAdapter implements PageHandlerAdapter {  @Override  public boolean supports(String dataSourceType) {  return PersistenceConstant.DM.equals(dataSourceType);  }  @Override  public OffsetFetchResult addOffsetAndFetchNext(String fetchSql, Object[] arg, int pageNo, int pageSize) {  if (!fetchSql.contains(AuthPageConstant.LIMIT)) {  fetchSql += " " + AuthPageConstant.LIMIT_SIZE;  List<Object> newArgsList = new ArrayList<>(Arrays.asList(arg));  newArgsList.add((pageNo - 1) * pageSize);  newArgsList.add(pageSize);  Object[] newArgs = newArgsList.toArray(new Object[0]);  return new OffsetFetchResult(fetchSql, newArgs);  }  return new OffsetFetchResult(fetchSql, arg);  }  }
分页适配工厂添加DM分页适配器

class: com.alibaba.nacos.plugin.auth.impl.persistence.handler.PageHandlerAdapterFactory
添加分页适配器:

private PageHandlerAdapterFactory() {  List<PageHandlerAdapter> handlerAdapters = new ArrayList<>(3);  Map<String, PageHandlerAdapter> handlerAdapterMap = new HashMap<>(3);  Consumer<PageHandlerAdapter> addHandlerAdapter = handlerAdapter -> {  handlerAdapters.add(handlerAdapter);  handlerAdapterMap.put(handlerAdapter.getClass().getName(), handlerAdapter);  };  // DmPageHandlerAdapter  addHandlerAdapter.accept(new DmPageHandlerAdapter());  // MysqlPageHandlerAdapter  addHandlerAdapter.accept(new MysqlPageHandlerAdapter());  // DerbyPageHandlerAdapter  addHandlerAdapter.accept(new DerbyPageHandlerAdapter());  // DefaultPageHandlerAdapter  addHandlerAdapter.accept(new DefaultPageHandlerAdapter());  this.handlerAdapters = Collections.unmodifiableList(handlerAdapters);  this.handlerAdapterMap = Collections.unmodifiableMap(handlerAdapterMap);  
}

修改数据源配置类ExternalDataSourceProperties

class: com.alibaba.nacos.persistence.datasource.ExternalDataSourceProperties
添加属性: private List<String> jdbcDriverName

private List<String> jdbcDriverName = new ArrayList<>();  public List<String> getJdbcDriverName() {  return jdbcDriverName;  
}  public void setJdbcDriverName(List<String> jdbcDriverName) {  this.jdbcDriverName = jdbcDriverName;  
}

image.png

修改 build方法中的数据源驱动部分
class: com.alibaba.nacos.persistence.datasource.ExternalDataSourceProperties#build

poolProperties.setDriverClassName(getOrDefault(jdbcDriverName,index,jdbcDriverName.get(index)).trim());

image.png

配置文件修改

  1. spring.sql.init.platform的值改为dm
  2. 添加db.jdbc-driver-name.0=dm.jdbc.driver.DmDriver
#驱动添加db.pool.config.driverClassName或者db.jdbc-driver-name二选一,(若有多数据源且数据库类型不同时可使用db.jdbc-driver-name),推荐使用db.jdbc-driver-name
# db.pool.config.driverClassName=dm.jdbc.driver.DmDriver
# db.jdbc-driver-name.0=dm.jdbc.driver.DmDriver# db.url.0=jdbc:dm://IP:5236/NACOS
# db.user.0=nacos
# db.password.0=nacos
  1. 修改url为db.url.0=jdbc:dm://IP:5236/DB
  2. nacos.core.auth.enabled修改为true
  3. 修改identity.key和identity.value为
nacos.core.auth.server.identity.key=${NACOS_AUTH_IDENTITY_KEY:nacos_key}
nacos.core.auth.server.identity.value=${NACOS_AUTH_IDENTITY_KEY:nacos_value} 	
  1. nacos.core.auth.plugin.nacos.token.secret.key改为
nacos.core.auth.plugin.nacos.token.secret.key=${NACOS_AUTH_TOKEN:TmFjb3NEbXp5ajk5ODEhQCMhUUFaWFNXMWRxaXVkdDhxaWN0ODczMmRhZGhhaXVkZzg2M2tqdg==}
  1. 添加: server.tomcat.accesslog.max-days=30

添加dm-scheme.sql

CREATE TABLE "USERS"  
(  "USERNAME" VARCHAR(50) NOT NULL,  "PASSWORD" VARCHAR(500) NOT NULL,  "ENABLED" TINYINT NOT NULL  
);  CREATE TABLE "TENANT_INFO"  
(  "ID" BIGINT IDENTITY(1,1) NOT NULL,  "KP" VARCHAR(128) NOT NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NULL,  "TENANT_NAME" VARCHAR(128) DEFAULT ''  NULL,  "TENANT_DESC" VARCHAR(256) NULL,  "CREATE_SOURCE" VARCHAR(32) NULL,  "GMT_CREATE" BIGINT NOT NULL,  "GMT_MODIFIED" BIGINT NOT NULL  
);  CREATE TABLE "TENANT_CAPACITY"  
(  "ID" BIGINT IDENTITY(1,1) NOT NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NOT NULL,  "QUOTA" BIGINT DEFAULT 0  NOT NULL,  "USAGE" BIGINT DEFAULT 0  NOT NULL,  "MAX_SIZE" BIGINT DEFAULT 0  NOT NULL,  "MAX_AGGR_COUNT" BIGINT DEFAULT 0  NOT NULL,  "MAX_AGGR_SIZE" BIGINT DEFAULT 0  NOT NULL,  "MAX_HISTORY_COUNT" BIGINT DEFAULT 0  NOT NULL,  "GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL  
);  CREATE TABLE "ROLES"  
(  "USERNAME" VARCHAR(50) NOT NULL,  "ROLE" VARCHAR(50) NOT NULL  
);  CREATE TABLE "PERMISSIONS"  
(  "ROLE" VARCHAR(50) NOT NULL,  "RESOURCE" VARCHAR(255) NOT NULL,  "ACTION" VARCHAR(8) NOT NULL  
);  CREATE TABLE "HIS_CONFIG_INFO"  
(  "ID" DECIMAL(20,0) NOT NULL,  "NID" BIGINT IDENTITY(1,1) NOT NULL,  "DATA_ID" VARCHAR(255) NOT NULL,  "GROUP_ID" VARCHAR(128) NOT NULL,  "APP_NAME" VARCHAR(128) NULL,  "CONTENT" CLOB NOT NULL,  "MD5" VARCHAR(32) NULL,  "GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "SRC_USER" TEXT NULL,  "SRC_IP" VARCHAR(50) NULL,  "OP_TYPE" CHAR(10) NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NULL,  "ENCRYPTED_DATA_KEY" TEXT NOT NULL  
);  CREATE TABLE "GROUP_CAPACITY"  
(  "ID" BIGINT IDENTITY(1,1) NOT NULL,  "GROUP_ID" VARCHAR(128) DEFAULT ''  NOT NULL,  "QUOTA" BIGINT DEFAULT 0  NOT NULL,  "USAGE" BIGINT DEFAULT 0  NOT NULL,  "MAX_SIZE" BIGINT DEFAULT 0  NOT NULL,  "MAX_AGGR_COUNT" BIGINT DEFAULT 0  NOT NULL,  "MAX_AGGR_SIZE" BIGINT DEFAULT 0  NOT NULL,  "MAX_HISTORY_COUNT" BIGINT DEFAULT 0  NOT NULL,  "GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL  
);  CREATE TABLE "CONFIG_TAGS_RELATION"  
(  "ID" BIGINT NOT NULL,  "TAG_NAME" VARCHAR(128) NOT NULL,  "TAG_TYPE" VARCHAR(64) NULL,  "DATA_ID" VARCHAR(255) NOT NULL,  "GROUP_ID" VARCHAR(128) NOT NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NULL,  "NID" BIGINT IDENTITY(1,1) NOT NULL  
);  CREATE TABLE "CONFIG_INFO_TAG"  
(  "ID" BIGINT IDENTITY(1,1) NOT NULL,  "DATA_ID" VARCHAR(255) NOT NULL,  "GROUP_ID" VARCHAR(128) NOT NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NULL,  "TAG_ID" VARCHAR(128) NOT NULL,  "APP_NAME" VARCHAR(128) NULL,  "CONTENT" CLOB NOT NULL,  "MD5" VARCHAR(32) NULL,  "GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "SRC_USER" TEXT NULL,  "SRC_IP" VARCHAR(50) NULL  
);  CREATE TABLE "CONFIG_INFO_BETA"  
(  "ID" BIGINT IDENTITY(1,1) NOT NULL,  "DATA_ID" VARCHAR(255) NOT NULL,  "GROUP_ID" VARCHAR(128) NOT NULL,  "APP_NAME" VARCHAR(128) NULL,  "CONTENT" CLOB NOT NULL,  "BETA_IPS" VARCHAR(1024) NULL,  "MD5" VARCHAR(32) NULL,  "GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "SRC_USER" TEXT NULL,  "SRC_IP" VARCHAR(50) NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NULL,  "ENCRYPTED_DATA_KEY" TEXT NOT NULL  
);  CREATE TABLE "CONFIG_INFO_AGGR"  
(  "ID" BIGINT IDENTITY(1,1) NOT NULL,  "DATA_ID" VARCHAR(255) NOT NULL,  "GROUP_ID" VARCHAR(128) NOT NULL,  "DATUM_ID" VARCHAR(255) NOT NULL,  "CONTENT" CLOB NOT NULL,  "GMT_MODIFIED" TIMESTAMP(0) NOT NULL,  "APP_NAME" VARCHAR(128) NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NULL  
);  CREATE TABLE "CONFIG_INFO"  
(  "ID" BIGINT IDENTITY(1,1) NOT NULL,  "DATA_ID" VARCHAR(255) NOT NULL,  "GROUP_ID" VARCHAR(128) NULL,  "CONTENT" CLOB NOT NULL,  "MD5" VARCHAR(32) NULL,  "GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "SRC_USER" TEXT NULL,  "SRC_IP" VARCHAR(50) NULL,  "APP_NAME" VARCHAR(128) NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NULL,  "C_DESC" VARCHAR(256) NULL,  "C_USE" VARCHAR(64) NULL,  "EFFECT" VARCHAR(64) NULL,  "TYPE" VARCHAR(64) NULL,  "C_SCHEMA" TEXT NULL,  "ENCRYPTED_DATA_KEY" TEXT NOT NULL  
);  SET IDENTITY_INSERT "CONFIG_INFO" ON;  
SET IDENTITY_INSERT "CONFIG_INFO" OFF;  
SET IDENTITY_INSERT "CONFIG_INFO_AGGR" ON;  
SET IDENTITY_INSERT "CONFIG_INFO_AGGR" OFF;  
SET IDENTITY_INSERT "CONFIG_INFO_BETA" ON;  
SET IDENTITY_INSERT "CONFIG_INFO_BETA" OFF;  
SET IDENTITY_INSERT "CONFIG_INFO_TAG" ON;  
SET IDENTITY_INSERT "CONFIG_INFO_TAG" OFF;  
SET IDENTITY_INSERT "CONFIG_TAGS_RELATION" ON;  
SET IDENTITY_INSERT "CONFIG_TAGS_RELATION" OFF;  
SET IDENTITY_INSERT "GROUP_CAPACITY" ON;  
SET IDENTITY_INSERT "GROUP_CAPACITY" OFF;  
SET IDENTITY_INSERT "HIS_CONFIG_INFO" ON;  
SET IDENTITY_INSERT "HIS_CONFIG_INFO" OFF;  
INSERT INTO "ROLES"("USERNAME","ROLE") VALUES('nacos','ROLE_ADMIN');  SET IDENTITY_INSERT "TENANT_CAPACITY" ON;  
SET IDENTITY_INSERT "TENANT_CAPACITY" OFF;  
SET IDENTITY_INSERT "TENANT_INFO" ON;  
SET IDENTITY_INSERT "TENANT_INFO" OFF;  
INSERT INTO "USERS"("USERNAME","PASSWORD","ENABLED") VALUES('nacos','$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu',1);  ALTER TABLE "USERS" ADD CONSTRAINT  PRIMARY KEY("USERNAME") ;  ALTER TABLE "TENANT_INFO" ADD CONSTRAINT  PRIMARY KEY("ID") ;  ALTER TABLE "TENANT_INFO" ADD CONSTRAINT "UK_TENANT_INFO_KPTENANTID" UNIQUE("KP","TENANT_ID") ;  ALTER TABLE "TENANT_CAPACITY" ADD CONSTRAINT  PRIMARY KEY("ID") ;  ALTER TABLE "TENANT_CAPACITY" ADD CONSTRAINT "UK_TENANT_ID" UNIQUE("TENANT_ID") ;  ALTER TABLE "ROLES" ADD CONSTRAINT "IDX_USER_ROLE" UNIQUE("USERNAME","ROLE") ;  ALTER TABLE "PERMISSIONS" ADD CONSTRAINT "UK_ROLE_PERMISSION" UNIQUE("ROLE","RESOURCE","ACTION") ;  ALTER TABLE "HIS_CONFIG_INFO" ADD CONSTRAINT  PRIMARY KEY("NID") ;  ALTER TABLE "GROUP_CAPACITY" ADD CONSTRAINT  PRIMARY KEY("ID") ;  ALTER TABLE "GROUP_CAPACITY" ADD CONSTRAINT "UK_GROUP_ID" UNIQUE("GROUP_ID") ;  ALTER TABLE "CONFIG_TAGS_RELATION" ADD CONSTRAINT  PRIMARY KEY("NID") ;  ALTER TABLE "CONFIG_TAGS_RELATION" ADD CONSTRAINT "UK_CONFIGTAGRELATION_CONFIGIDTAG" UNIQUE("ID","TAG_NAME","TAG_TYPE") ;  ALTER TABLE "CONFIG_INFO_TAG" ADD CONSTRAINT  PRIMARY KEY("ID") ;  ALTER TABLE "CONFIG_INFO_TAG" ADD CONSTRAINT "UK_CONFIGINFOTAG_DATAGROUPTENANTTAG" UNIQUE("DATA_ID","GROUP_ID","TENANT_ID","TAG_ID") ;  ALTER TABLE "CONFIG_INFO_BETA" ADD CONSTRAINT  PRIMARY KEY("ID") ;  ALTER TABLE "CONFIG_INFO_BETA" ADD CONSTRAINT "UK_CONFIGINFOBETA_DATAGROUPTENANT" UNIQUE("DATA_ID","GROUP_ID","TENANT_ID") ;  ALTER TABLE "CONFIG_INFO_AGGR" ADD CONSTRAINT  PRIMARY KEY("ID") ;  ALTER TABLE "CONFIG_INFO_AGGR" ADD CONSTRAINT "UK_CONFIGINFOAGGR_DATAGROUPTENANTDATUM" UNIQUE("DATA_ID","GROUP_ID","TENANT_ID","DATUM_ID") ;  ALTER TABLE "CONFIG_INFO" ADD CONSTRAINT  PRIMARY KEY("ID") ;  ALTER TABLE "CONFIG_INFO" ADD CONSTRAINT "UK_CONFIGINFO_DATAGROUPTENANT" UNIQUE("DATA_ID","GROUP_ID","TENANT_ID") ;  CREATE UNIQUE INDEX "PRIMARY"  
ON "USERS"("USERNAME");  COMMENT ON COLUMN "USERS"."USERNAME" IS 'username';  COMMENT ON COLUMN "USERS"."PASSWORD" IS 'password';  COMMENT ON COLUMN "USERS"."ENABLED" IS 'enabled';  CREATE INDEX "IDX_TENANT_ID"  
ON "TENANT_INFO"("TENANT_ID");  CREATE UNIQUE INDEX "INDEX134402165964299"  
ON "TENANT_INFO"("ID");  COMMENT ON TABLE "TENANT_INFO" IS 'tenant_info';  COMMENT ON COLUMN "TENANT_INFO"."ID" IS 'id';  COMMENT ON COLUMN "TENANT_INFO"."KP" IS 'kp';  COMMENT ON COLUMN "TENANT_INFO"."TENANT_ID" IS 'tenant_id';  COMMENT ON COLUMN "TENANT_INFO"."TENANT_NAME" IS 'tenant_name';  COMMENT ON COLUMN "TENANT_INFO"."TENANT_DESC" IS 'tenant_desc';  COMMENT ON COLUMN "TENANT_INFO"."CREATE_SOURCE" IS 'create_source';  COMMENT ON COLUMN "TENANT_INFO"."GMT_CREATE" IS '创建时间';  COMMENT ON COLUMN "TENANT_INFO"."GMT_MODIFIED" IS '修改时间';  ALTER TABLE "TENANT_CAPACITY" ADD CHECK ("QUOTA" >= 0) ENABLE ;  ALTER TABLE "TENANT_CAPACITY" ADD CHECK ("MAX_HISTORY_COUNT" >= 0) ENABLE ;  ALTER TABLE "TENANT_CAPACITY" ADD CHECK ("MAX_AGGR_SIZE" >= 0) ENABLE ;  ALTER TABLE "TENANT_CAPACITY" ADD CHECK ("MAX_AGGR_COUNT" >= 0) ENABLE ;  ALTER TABLE "TENANT_CAPACITY" ADD CHECK ("MAX_SIZE" >= 0) ENABLE ;  ALTER TABLE "TENANT_CAPACITY" ADD CHECK ("USAGE" >= 0) ENABLE ;  CREATE UNIQUE INDEX "INDEX134403016796300"  
ON "TENANT_CAPACITY"("ID");  COMMENT ON TABLE "TENANT_CAPACITY" IS '租户容量信息表';  COMMENT ON COLUMN "TENANT_CAPACITY"."ID" IS '主键ID';  COMMENT ON COLUMN "TENANT_CAPACITY"."TENANT_ID" IS 'Tenant ID';  COMMENT ON COLUMN "TENANT_CAPACITY"."QUOTA" IS '配额,0表示使用默认值';  COMMENT ON COLUMN "TENANT_CAPACITY"."USAGE" IS '使用量';  COMMENT ON COLUMN "TENANT_CAPACITY"."MAX_SIZE" IS '单个配置大小上限,单位为字节,0表示使用默认值';  COMMENT ON COLUMN "TENANT_CAPACITY"."MAX_AGGR_COUNT" IS '聚合子配置最大个数';  COMMENT ON COLUMN "TENANT_CAPACITY"."MAX_AGGR_SIZE" IS '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值';  COMMENT ON COLUMN "TENANT_CAPACITY"."MAX_HISTORY_COUNT" IS '最大变更历史数量';  COMMENT ON COLUMN "TENANT_CAPACITY"."GMT_CREATE" IS '创建时间';  COMMENT ON COLUMN "TENANT_CAPACITY"."GMT_MODIFIED" IS '修改时间';  COMMENT ON COLUMN "ROLES"."USERNAME" IS 'username';  COMMENT ON COLUMN "ROLES"."ROLE" IS 'role';  COMMENT ON COLUMN "PERMISSIONS"."ROLE" IS 'role';  COMMENT ON COLUMN "PERMISSIONS"."RESOURCE" IS 'resource';  COMMENT ON COLUMN "PERMISSIONS"."ACTION" IS 'action';  ALTER TABLE "HIS_CONFIG_INFO" ADD CHECK ("ID" >= 0) ENABLE ;  CREATE INDEX "IDX_DID"  
ON "HIS_CONFIG_INFO"("DATA_ID");  CREATE INDEX "IDX_GMT_MODIFIED"  
ON "HIS_CONFIG_INFO"("GMT_MODIFIED");  CREATE INDEX "IDX_GMT_CREATE"  
ON "HIS_CONFIG_INFO"("GMT_CREATE");  CREATE UNIQUE INDEX "INDEX134404266256800"  
ON "HIS_CONFIG_INFO"("NID");  COMMENT ON TABLE "HIS_CONFIG_INFO" IS '多租户改造';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."ID" IS 'id';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."NID" IS 'nid, 自增标识';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."DATA_ID" IS 'data_id';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."GROUP_ID" IS 'group_id';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."APP_NAME" IS 'app_name';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."CONTENT" IS 'content';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."MD5" IS 'md5';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."GMT_CREATE" IS '创建时间';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."GMT_MODIFIED" IS '修改时间';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."SRC_USER" IS 'source user';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."SRC_IP" IS 'source ip';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."OP_TYPE" IS 'operation type';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."TENANT_ID" IS '租户字段';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."ENCRYPTED_DATA_KEY" IS '密钥';  ALTER TABLE "GROUP_CAPACITY" ADD CHECK ("QUOTA" >= 0) ENABLE ;  ALTER TABLE "GROUP_CAPACITY" ADD CHECK ("MAX_HISTORY_COUNT" >= 0) ENABLE ;  ALTER TABLE "GROUP_CAPACITY" ADD CHECK ("MAX_AGGR_SIZE" >= 0) ENABLE ;  ALTER TABLE "GROUP_CAPACITY" ADD CHECK ("MAX_AGGR_COUNT" >= 0) ENABLE ;  ALTER TABLE "GROUP_CAPACITY" ADD CHECK ("MAX_SIZE" >= 0) ENABLE ;  ALTER TABLE "GROUP_CAPACITY" ADD CHECK ("USAGE" >= 0) ENABLE ;  CREATE UNIQUE INDEX "INDEX134405629453900"  
ON "GROUP_CAPACITY"("ID");  COMMENT ON TABLE "GROUP_CAPACITY" IS '集群、各Group容量信息表';  COMMENT ON COLUMN "GROUP_CAPACITY"."ID" IS '主键ID';  COMMENT ON COLUMN "GROUP_CAPACITY"."GROUP_ID" IS 'Group ID,空字符表示整个集群';  COMMENT ON COLUMN "GROUP_CAPACITY"."QUOTA" IS '配额,0表示使用默认值';  COMMENT ON COLUMN "GROUP_CAPACITY"."USAGE" IS '使用量';  COMMENT ON COLUMN "GROUP_CAPACITY"."MAX_SIZE" IS '单个配置大小上限,单位为字节,0表示使用默认值';  COMMENT ON COLUMN "GROUP_CAPACITY"."MAX_AGGR_COUNT" IS '聚合子配置最大个数,,0表示使用默认值';  COMMENT ON COLUMN "GROUP_CAPACITY"."MAX_AGGR_SIZE" IS '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值';  COMMENT ON COLUMN "GROUP_CAPACITY"."MAX_HISTORY_COUNT" IS '最大变更历史数量';  COMMENT ON COLUMN "GROUP_CAPACITY"."GMT_CREATE" IS '创建时间';  COMMENT ON COLUMN "GROUP_CAPACITY"."GMT_MODIFIED" IS '修改时间';  CREATE INDEX "INDEX134406418558100"  
ON "CONFIG_TAGS_RELATION"("TENANT_ID");  CREATE UNIQUE INDEX "INDEX134406537578900"  
ON "CONFIG_TAGS_RELATION"("NID");  COMMENT ON TABLE "CONFIG_TAGS_RELATION" IS 'config_tag_relation';  COMMENT ON COLUMN "CONFIG_TAGS_RELATION"."ID" IS 'id';  COMMENT ON COLUMN "CONFIG_TAGS_RELATION"."TAG_NAME" IS 'tag_name';  COMMENT ON COLUMN "CONFIG_TAGS_RELATION"."TAG_TYPE" IS 'tag_type';  COMMENT ON COLUMN "CONFIG_TAGS_RELATION"."DATA_ID" IS 'data_id';  COMMENT ON COLUMN "CONFIG_TAGS_RELATION"."GROUP_ID" IS 'group_id';  COMMENT ON COLUMN "CONFIG_TAGS_RELATION"."TENANT_ID" IS 'tenant_id';  COMMENT ON COLUMN "CONFIG_TAGS_RELATION"."NID" IS 'nid, 自增长标识';  CREATE UNIQUE INDEX "INDEX134407033963000"  
ON "CONFIG_INFO_TAG"("ID");  COMMENT ON TABLE "CONFIG_INFO_TAG" IS 'config_info_tag';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."ID" IS 'id';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."DATA_ID" IS 'data_id';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."GROUP_ID" IS 'group_id';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."TENANT_ID" IS 'tenant_id';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."TAG_ID" IS 'tag_id';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."APP_NAME" IS 'app_name';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."CONTENT" IS 'content';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."MD5" IS 'md5';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."GMT_CREATE" IS '创建时间';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."GMT_MODIFIED" IS '修改时间';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."SRC_USER" IS 'source user';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."SRC_IP" IS 'source ip';  CREATE UNIQUE INDEX "INDEX134407798104699"  
ON "CONFIG_INFO_BETA"("ID");  COMMENT ON TABLE "CONFIG_INFO_BETA" IS 'config_info_beta';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."ID" IS 'id';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."DATA_ID" IS 'data_id';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."GROUP_ID" IS 'group_id';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."APP_NAME" IS 'app_name';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."CONTENT" IS 'content';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."BETA_IPS" IS 'betaIps';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."MD5" IS 'md5';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."GMT_CREATE" IS '创建时间';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."GMT_MODIFIED" IS '修改时间';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."SRC_USER" IS 'source user';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."SRC_IP" IS 'source ip';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."TENANT_ID" IS '租户字段';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."ENCRYPTED_DATA_KEY" IS '密钥';  CREATE UNIQUE INDEX "INDEX134408619300900"  
ON "CONFIG_INFO_AGGR"("ID");  COMMENT ON TABLE "CONFIG_INFO_AGGR" IS '增加租户字段';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."ID" IS 'id';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."DATA_ID" IS 'data_id';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."GROUP_ID" IS 'group_id';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."DATUM_ID" IS 'datum_id';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."CONTENT" IS '内容';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."GMT_MODIFIED" IS '修改时间';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."APP_NAME" IS 'app_name';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."TENANT_ID" IS '租户字段';  CREATE UNIQUE INDEX "INDEX134409166029299"  
ON "CONFIG_INFO"("ID");  COMMENT ON TABLE "CONFIG_INFO" IS 'config_info';  COMMENT ON COLUMN "CONFIG_INFO"."ID" IS 'id';  COMMENT ON COLUMN "CONFIG_INFO"."DATA_ID" IS 'data_id';  COMMENT ON COLUMN "CONFIG_INFO"."GROUP_ID" IS 'group_id';  COMMENT ON COLUMN "CONFIG_INFO"."CONTENT" IS 'content';  COMMENT ON COLUMN "CONFIG_INFO"."MD5" IS 'md5';  COMMENT ON COLUMN "CONFIG_INFO"."GMT_CREATE" IS '创建时间';  COMMENT ON COLUMN "CONFIG_INFO"."GMT_MODIFIED" IS '修改时间';  COMMENT ON COLUMN "CONFIG_INFO"."SRC_USER" IS 'source user';  COMMENT ON COLUMN "CONFIG_INFO"."SRC_IP" IS 'source ip';  COMMENT ON COLUMN "CONFIG_INFO"."APP_NAME" IS 'app_name';  COMMENT ON COLUMN "CONFIG_INFO"."TENANT_ID" IS '租户字段';  COMMENT ON COLUMN "CONFIG_INFO"."C_DESC" IS 'configuration description';  COMMENT ON COLUMN "CONFIG_INFO"."C_USE" IS 'configuration usage';  COMMENT ON COLUMN "CONFIG_INFO"."EFFECT" IS '配置生效的描述';  COMMENT ON COLUMN "CONFIG_INFO"."TYPE" IS '配置的类型';  COMMENT ON COLUMN "CONFIG_INFO"."C_SCHEMA" IS '配置的模式';  COMMENT ON COLUMN "CONFIG_INFO"."ENCRYPTED_DATA_KEY" IS '密钥';

编译打包

mvn -Prelease-nacos clean install -Dmaven.test.skip=true -Dcheckstyle.skip=true -Dpmd.skip=true -Drat.skip=true -U

打包完成生成包的位置

image.png

这篇关于适配Nacos2.4.1 达梦数据库DM8版本的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1095207

相关文章

Spring Security基于数据库验证流程详解

Spring Security 校验流程图 相关解释说明(认真看哦) AbstractAuthenticationProcessingFilter 抽象类 /*** 调用 #requiresAuthentication(HttpServletRequest, HttpServletResponse) 决定是否需要进行验证操作。* 如果需要验证,则会调用 #attemptAuthentica

MySQL数据库宕机,启动不起来,教你一招搞定!

作者介绍:老苏,10余年DBA工作运维经验,擅长Oracle、MySQL、PG、Mongodb数据库运维(如安装迁移,性能优化、故障应急处理等)公众号:老苏畅谈运维欢迎关注本人公众号,更多精彩与您分享。 MySQL数据库宕机,数据页损坏问题,启动不起来,该如何排查和解决,本文将为你说明具体的排查过程。 查看MySQL error日志 查看 MySQL error日志,排查哪个表(表空间

Android实现任意版本设置默认的锁屏壁纸和桌面壁纸(两张壁纸可不一致)

客户有些需求需要设置默认壁纸和锁屏壁纸  在默认情况下 这两个壁纸是相同的  如果需要默认的锁屏壁纸和桌面壁纸不一样 需要额外修改 Android13实现 替换默认桌面壁纸: 将图片文件替换frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.*  (注意不能是bmp格式) 替换默认锁屏壁纸: 将图片资源放入vendo

深入理解数据库的 4NF:多值依赖与消除数据异常

在数据库设计中, "范式" 是一个常常被提到的重要概念。许多初学者在学习数据库设计时,经常听到第一范式(1NF)、第二范式(2NF)、第三范式(3NF)以及 BCNF(Boyce-Codd范式)。这些范式都旨在通过消除数据冗余和异常来优化数据库结构。然而,当我们谈到 4NF(第四范式)时,事情变得更加复杂。本文将带你深入了解 多值依赖 和 4NF,帮助你在数据库设计中消除更高级别的异常。 什么是

DM8数据库安装后配置

1 前言 在上篇文章中,我们已经成功将库装好。在安装完成后,为了能够更好地满足应用需求和保障系统的安全稳定运行,通常需要进行一些基本的配置。下面是一些常见的配置项: 数据库服务注册:默认包含14个功能模块,将这些模块注册成服务后,可以更好的启动和管理这些功能;基本的实例参数配置:契合应用场景和发挥系统的最大性能;备份:有备无患;… 2 注册实例服务 注册了实例服务后,可以使用系统服务管理,

速了解MySQL 数据库不同存储引擎

快速了解MySQL 数据库不同存储引擎 MySQL 提供了多种存储引擎,每种存储引擎都有其特定的特性和适用场景。了解这些存储引擎的特性,有助于在设计数据库时做出合理的选择。以下是 MySQL 中几种常用存储引擎的详细介绍。 1. InnoDB 特点: 事务支持:InnoDB 是一个支持 ACID(原子性、一致性、隔离性、持久性)事务的存储引擎。行级锁:使用行级锁来提高并发性,减少锁竞争

开源分布式数据库中间件

转自:https://www.csdn.net/article/2015-07-16/2825228 MyCat:开源分布式数据库中间件 为什么需要MyCat? 虽然云计算时代,传统数据库存在着先天性的弊端,但是NoSQL数据库又无法将其替代。如果传统数据易于扩展,可切分,就可以避免单机(单库)的性能缺陷。 MyCat的目标就是:低成本地将现有的单机数据库和应用平滑迁移到“云”端

ORACLE 11g 创建数据库时 Enterprise Manager配置失败的解决办法 无法打开OEM的解决办法

在win7 64位系统下安装oracle11g,在使用Database configuration Assistant创建数据库时,在创建到85%的时候报错,错误如下: 解决办法: 在listener.ora中增加对BlueAeri-PC或ip地址的侦听,具体步骤如下: 1.启动Net Manager,在“监听程序”--Listener下添加一个地址,主机名写计

MyBatis 切换不同的类型数据库方案

下属案例例当前结合SpringBoot 配置进行讲解。 背景: 实现一个工程里面在部署阶段支持切换不同类型数据库支持。 方案一 数据源配置 关键代码(是什么数据库,该怎么配就怎么配) spring:datasource:name: test# 使用druid数据源type: com.alibaba.druid.pool.DruidDataSource# @需要修改 数据库连接及驱动u

CentOS下mysql数据库data目录迁移

https://my.oschina.net/u/873762/blog/180388        公司新上线一个资讯网站,独立主机,raid5,lamp架构。由于资讯网是面向小行业,初步估计一两年内访问量压力不大,故,在做服务器系统搭建的时候,只是简单分出一个独立的data区作为数据库和网站程序的专区,其他按照linux的默认分区。apache,mysql,php均使用yum安装(也尝试