Automatically detects if a database needs migration and performs it
This function is called automatically by CollegeDB operations to detect
existing databases that contain data but haven't been integrated into the
sharding system. It performs seamless migration without user intervention.
The detection process:
Checks if the database has data tables with primary keys
Verifies if primary key mappings exist in KV
If unmapped data is found, performs automatic integration
Caches results to avoid repeated checks
Parameters
d1: D1Database
The D1 database instance to check and potentially migrate
Automatically detects if a database needs migration and performs it
This function is called automatically by CollegeDB operations to detect existing databases that contain data but haven't been integrated into the sharding system. It performs seamless migration without user intervention.
The detection process: