mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-08-02 05:20:15 +08:00
Add operation log
This commit is contained in:
@ -21,9 +21,9 @@ public class OracleDBManage extends DefaultDBManage implements DBManage {
|
||||
}
|
||||
String schemaName = connectInfo.getSchemaName();
|
||||
try {
|
||||
SQLExecutor.getInstance().execute(connection, "ALTER SESSION SET CURRENT_SCHEMA = \"" + schemaName + "\";");
|
||||
SQLExecutor.getInstance().execute(connection, "ALTER SESSION SET CURRENT_SCHEMA = \"" + schemaName + "\"");
|
||||
} catch (SQLException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ public enum OracleIndexTypeEnum {
|
||||
for (TableIndexColumn column : tableIndex.getColumnList()) {
|
||||
if (StringUtils.isNotBlank(column.getColumnName())) {
|
||||
script.append("\"").append(column.getColumnName()).append("\"");
|
||||
if (!StringUtils.isBlank(column.getAscOrDesc())) {
|
||||
if (!StringUtils.isBlank(column.getAscOrDesc()) && !PRIMARY_KEY.equals(this)) {
|
||||
script.append(" ").append(column.getAscOrDesc());
|
||||
}
|
||||
script.append(",");
|
||||
@ -111,7 +111,8 @@ public enum OracleIndexTypeEnum {
|
||||
|
||||
private String buildDropIndex(TableIndex tableIndex) {
|
||||
if (OracleIndexTypeEnum.PRIMARY_KEY.getName().equals(tableIndex.getType())) {
|
||||
return StringUtils.join("DROP PRIMARY KEY");
|
||||
String tableName = "\"" + tableIndex.getSchemaName() + "\"." + "\"" + tableIndex.getTableName() + "\"";
|
||||
return StringUtils.join("ALTER TABLE ",tableName," DROP PRIMARY KEY");
|
||||
}
|
||||
StringBuilder script = new StringBuilder();
|
||||
script.append("DROP INDEX ");
|
||||
|
@ -17,12 +17,12 @@
|
||||
<groupId>ai.chat2db</groupId>
|
||||
<artifactId>chat2db-spi</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>mssql-jdbc</artifactId>
|
||||
<version>11.2.1.jre17</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.microsoft.sqlserver</groupId>-->
|
||||
<!-- <artifactId>mssql-jdbc</artifactId>-->
|
||||
<!-- <version>11.2.1.jre17</version>-->
|
||||
<!-- <scope>test</scope>-->
|
||||
<!-- </dependency>-->
|
||||
</dependencies>
|
||||
|
||||
</project>
|
Reference in New Issue
Block a user