mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-09-21 12:03:20 +08:00
support oracle table edit
This commit is contained in:
@ -161,9 +161,20 @@ public class TableController {
|
||||
*/
|
||||
@PostMapping("/modify/sql")
|
||||
public ListResult<SqlVO> modifySql(@Valid @RequestBody TableModifySqlRequest request) {
|
||||
return tableService.buildSql(
|
||||
rdbWebConverter.tableRequest2param(request.getOldTable()),
|
||||
rdbWebConverter.tableRequest2param(request.getNewTable()))
|
||||
Table table = rdbWebConverter.tableRequest2param(request.getNewTable());
|
||||
table.setSchemaName(request.getSchemaName());
|
||||
table.setDatabaseName(request.getDatabaseName());
|
||||
for (TableColumn tableColumn : table.getColumnList()) {
|
||||
tableColumn.setSchemaName(request.getSchemaName());
|
||||
tableColumn.setTableName(table.getName());
|
||||
tableColumn.setDatabaseName(request.getDatabaseName());
|
||||
}
|
||||
for (TableIndex tableIndex : table.getIndexList()) {
|
||||
tableIndex.setSchemaName(request.getSchemaName());
|
||||
tableIndex.setTableName(table.getName());
|
||||
tableIndex.setDatabaseName(request.getDatabaseName());
|
||||
}
|
||||
return tableService.buildSql(rdbWebConverter.tableRequest2param(request.getOldTable()),table)
|
||||
.map(rdbWebConverter::dto2vo);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user