fix: remove non-existent auth_apiname from uapi query, add error handling

This commit is contained in:
yumoqing 2026-05-20 16:31:25 +08:00
parent 29a397bbf4
commit f0bf47881b

View File

@ -31,11 +31,15 @@ async def generate_migration_sql():
]
# Load data
try:
async with db.sqlorContext(dbname) as sor:
# Get all upapps
upapps = await sor.sqlExe('select id, name, apisetid from upapp', {})
# Get all uapis
uapis = await sor.sqlExe('select id, apisetid, name, httpmethod, path, headers, ioid, auth_apiname, response, params, data, chunk_match from uapi', {})
# Get all uapis (removed non-existent auth_apiname field)
uapis = await sor.sqlExe('select id, apisetid, name, httpmethod, path, headers, ioid, response, params, data, chunk_match from uapi', {})
except Exception as e:
print(f"Error querying database: {e}", file=sys.stderr)
sys.exit(1)
# Build mapping: apisetid -> [upapp1, upapp2, ...]
apiset_to_upapps = {}