...
|
...
|
@@ -29,9 +29,9 @@ func (ptr *CopyDataTableService) CopyTable(ctx *domain.Context, tableId int, tab |
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
if !(table.TableType == domain.MainTable.ToString() || table.TableType == domain.SubTable.ToString()) {
|
|
|
return nil, fmt.Errorf("主表、分表才允许复制")
|
|
|
}
|
|
|
//if !(table.TableType == domain.MainTable.ToString() || table.TableType == domain.SubTable.ToString()) {
|
|
|
// return nil, fmt.Errorf("主表、分表才允许复制")
|
|
|
//}
|
|
|
var mainTable *domain.Table
|
|
|
dataFields := table.DataFields
|
|
|
if table.TableType == domain.SubTable.ToString() {
|
...
|
...
|
@@ -47,9 +47,9 @@ func (ptr *CopyDataTableService) CopyTable(ctx *domain.Context, tableId int, tab |
|
|
}
|
|
|
// 验证表名是否重复
|
|
|
duplicateTable, err := tableRepository.FindOne(map[string]interface{}{
|
|
|
"context": ctx,
|
|
|
"tableName": tableName,
|
|
|
"tableTypes":domain.TableTypesToStringList(domain.MainTable,domain.SubTable,domain.SideTable)})
|
|
|
"context": ctx,
|
|
|
"tableName": tableName,
|
|
|
"tableTypes": domain.TableTypesToStringList(domain.MainTable, domain.SubTable, domain.SideTable)})
|
|
|
if err == nil && duplicateTable != nil {
|
|
|
return nil, fmt.Errorf("表名称重复")
|
|
|
}
|
...
|
...
|
|