Closed muguan1995 closed 2 months ago
🤖
你好,@muguan1995!很高兴再次看到你的提问。
根据我找到的相关问题,你可以参考以下步骤来升级你的Apollo数据库结构版本:
连接到Apollo使用的MySQL数据库。你可以使用MySQL客户端,如MySQL Workbench,或者使用mysql
命令从命令行进行连接。
使用USE
命令选择ApolloPortalDB数据库:
USE ApolloPortalDB;
DeletedAt
列:ALTER TABLE `App`
ADD COLUMN `DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds' AFTER `IsDeleted`;
-- 根据脚本重复其他表的操作
请注意,在执行任何升级操作之前,你应该备份你的数据库,以防万一出现问题导致数据丢失。同时,确保SQL脚本与你当前的数据库版本和结构兼容。
从2.1版本到最新的2.2.0版本,Apollo数据库结构的具体变化如下:
App
、Commit
、Namespace
、Release
和AccessKey
表中的AppId
列已被修改为具有VARCHAR(64)数据类型,NOT NULL约束,并且默认值为'default'。
Commit
表中的AppId
索引已被删除并重新添加。
Namespace
表中的唯一索引UK_AppId_ClusterName_NamespaceName_DeletedAt
已被删除并重新添加,列名相同。
Release
表中的AppId_ClusterName_GroupName
索引已被删除并重新添加,列名为(AppId
,ClusterName
(191),NamespaceName
(191),DeletedAt
)。
添加了AuditLog
表,包含以下列:Id
、TraceId
、SpanId
、ParentSpanId
、FollowsFromSpanId
、Operator
、OpType
、OpName
、Description
、IsDeleted
、DeletedAt
、DataChange_CreatedBy
、DataChange_CreatedTime
、DataChange_LastModifiedBy
、DataChange_LastTime
。
添加了AuditLogDataInfluence
表,包含以下列:Id
、SpanId
、InfluenceEntityId
、InfluenceEntityName
、FieldName
、FieldOldValue
、FieldNewValue
、IsDeleted
、DeletedAt
、DataChange_CreatedBy
、DataChange_CreatedTime
、DataChange_LastModifiedBy
、DataChange_LastTime
。
这些变化可以在提供的SQL脚本中看到。
参考资料:
转移到 https://github.com/apolloconfig/apollo/tree/master/scripts/sql/profiles/mysql-default/delta 了
找到了,感谢。顺便请问一下 v190-v200/apolloportaldb-v190-v200-after.sql 和普通的apolloportaldb-v190-v200.sql 区别是什么两个都要执行就行了吧
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in the last 7 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.
scripts/sql/src 目录下没有2.1之前的升级sql文件了,原来低版本的apollo要如何升级数据库结构版本呢?