feat(database): PTC Object 手动建表、版本迁移、PostgreSQL Schema 支持#667
Merged
Bkm016 merged 1 commit intoTabooLib:dev/6.2.3from Feb 15, 2026
Merged
Conversation
- @TableName 新增 schema 参数,支持 PostgreSQL 自定义 Schema
- resolveTableName() 支持 schema.tableName 格式
- 新增 manualTable() 跳过自动建表,执行用户提供的 SQL
- 新增 migration {} 版本迁移机制,通过 _ptc_meta 表跟踪版本号
- ContainerPostgreSQL 建表前自动 CREATE SCHEMA IF NOT EXISTS
- 修复 PostgreSQL 索引名含 schema 点号导致的语法错误
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动概述
在已有的
@Ignore注解基础上,继续增强 PTC Object ORM 模块,新增三项功能:1. 手动建表 (
manualTable)跳过框架自动建表,执行用户提供的 SQL 语句创建表结构。
2. 版本迁移 (
migration)通过
_ptc_meta表跟踪版本号,按版本执行迁移 SQL。3. PostgreSQL Schema 支持
@TableName新增schema参数,建表前自动CREATE SCHEMA IF NOT EXISTS。修改文件
Annotations.kt—@TableName新增schema参数AnalyzedClassMember.kt—resolveTableName()支持 schema 前缀MapperDelegate.kt—MapperConfig新增manualTable()/migration()MigrationConfig.kt— 新建迁移配置类Container.kt—init()支持手动建表和版本迁移ContainerPostgreSQL.kt— 建表前自动创建 SchemaExecutableSource.kt— 修复 PostgreSQL 索引名含 schema 点号的语法错误