@earth-app/collegedb
    Preparing search index...

    Function checkMigrationNeeded

    • Performs a lightweight check to determine if a database contains existing data that hasn't been mapped to the sharding system. This is used internally to trigger automatic migration.

      Parameters

      • d1: D1Database

        The D1 database instance to check

      • shardName: string

        The shard binding name

      • config: CollegeDBConfig

        CollegeDB configuration

      Returns Promise<boolean>

      Promise resolving to true if migration is needed

      const needsMigration = await checkMigrationNeeded(env.DB, 'db-main', config);
      if (needsMigration) {
      console.log('Database contains unmapped data');
      }