Class SchemaHelper
java.lang.Object
cool.scx.jdbc.SchemaHelper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordstatic final record -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckNeedFixTable(Table tableInfo, JDBCContext jdbcContext) 检查是否需要修复表static voidfixTable(Table tableInfo, JDBCContext jdbcContext) 和当前数据中同名表进行比对 进行修复 (若表不存在则创建,若存在则只添加不存在的列)static StringgetMigrateSQL(Table oldTable, Table newTable, Dialect dialect) 获取迁移 SQL (当前只支持 创建不存在的新列) todo 需要支持删除旧列和修改列verifyColumn(Column oldColumn, Column newColumn) verifyTable(Table oldTable, Table newTable)
-
Constructor Details
-
SchemaHelper
public SchemaHelper()
-
-
Method Details
-
getMigrateSQL
-
verifyColumn
-
verifyTable
-
fixTable
和当前数据中同名表进行比对 进行修复 (若表不存在则创建,若存在则只添加不存在的列)- Parameters:
tableInfo- a- Throws:
SQLException- a
-
checkNeedFixTable
public static boolean checkNeedFixTable(Table tableInfo, JDBCContext jdbcContext) throws SQLException 检查是否需要修复表- Parameters:
tableInfo- a- Returns:
- true 需要 false 不需要
- Throws:
SQLException- e
-