适配 Oracle 数据库

1. 适配表名是大写的情况
2. 优化代码生成器的校验逻辑
This commit is contained in:
YunaiV
2022-05-01 19:47:30 +08:00
parent 6f18adb54a
commit 2bd2313434
6 changed files with 54 additions and 33 deletions

View File

@ -1,5 +1,5 @@
-- 将该建表 SQL 语句,添加到 yudao-module-${table.moduleName}-biz 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "${table.tableName}" (
CREATE TABLE IF NOT EXISTS "${table.tableName.toLowerCase()}" (
#foreach ($column in $columns)
#if (${column.javaType} == 'Long')
#set ($dataType='bigint')
@ -24,11 +24,11 @@ CREATE TABLE IF NOT EXISTS "${table.tableName}" (
#elseif (${column.columnName} == 'deleted')
"deleted" bit NOT NULL DEFAULT FALSE,
#else
"${column.columnName}" ${dataType}#if (${column.nullable} == false) NOT NULL#end,
"${column.columnName.toLowerCase()}" ${dataType}#if (${column.nullable} == false) NOT NULL#end,
#end
#end
#end
PRIMARY KEY ("${primaryColumn.columnName}")
PRIMARY KEY ("${primaryColumn.columnName.toLowerCase()}")
) COMMENT '${table.tableComment}';
-- 将该删表 SQL 语句,添加到 yudao-module-${table.moduleName}-biz 模块的 test/resources/sql/clean.sql 文件里