function main() {
    // 验证用户权限
    'use api/user/acl/excerpt.js'

    let tableId = payload.get().path.split('/').pop()
    let newTableId = ex.suid().base58()
    let query = `INSERT INTO dm_tables (table_id, table_name, table_comment, class_name, module_name, business_name, function_name, function_author, pk_column,  pk_field_name, proprietor_id, proprietor_name) SELECT ?, table_name, table_comment, class_name, module_name, business_name, function_name, function_author, pk_column,  pk_field_name, proprietor_id, proprietor_name FROM dm_tables WHERE table_id =?`
    let res = SQL.exec('system_sql', query, newTableId, tableId)
    if (!res) {
        return errMsg(507, '创建表信息失败')
    }
    query = `SELECT column_id FROM dm_table_columns WHERE table_id =?`;
    res = SQL.query('system_sql', query, tableId)
    let newColumnId

    res.forEach((columnId) => {
        newColumnId = ex.suid().base58()
        query = `INSERT INTO dm_table_columns (column_id, table_id, sort, table_name, column_name, column_comment, column_type, column_key, field_name, is_pk, is_required, is_insert, is_show, is_edit, is_list, is_query, is_acl, is_group, calc_type, is_order, query_type, search_value, default_value, is_increment, html_type, html_width, dict_type, proprietor_id, proprietor_name) SELECT '${newColumnId}', '${newTableId}', sort, table_name, column_name, column_comment, column_type, column_key, field_name, is_pk, is_required, is_insert, is_show, is_edit, is_list, is_query, is_acl, is_group, calc_type, is_order, query_type, search_value, default_value, is_increment, html_type, html_width, dict_type, proprietor_id, proprietor_name FROM dm_table_columns WHERE column_id =?`
        // console.log(query, columnId.column_id)
        SQL.exec('system_sql', query, columnId.column_id)
    })

    return okMsg(newTableId)

}