def migrate(self, migrations_package_name, up_to=<NUM_LIT>):
from .migrations import MigrationHistory<EOL>logger = logging.getLogger('<STR_LIT>')<EOL>applied_migrations = self._get_applied_migrations(migrations_package_name)<EOL>modules = import_submodules(migrations_package_name)<EOL>unapplied_migrations = set(modules.keys()) - applied_migrations<EOL>for name in sorted(unapplied_migrations):<EOL><INDENT>logger.info('<STR_LIT>', name)<EOL>for operation in modules[name].operations:<EOL><INDENT>operation.apply(self)<EOL><DEDENT>self.insert([MigrationHistory(package_name=migrations_package_name, module_name=name, applied=datetime.date.today())])<EOL>if int(name[:<NUM_LIT:4>]) >= up_to:<EOL><INDENT>break<EOL><DEDENT><DEDENT>
Executes schema migrations.

- `migrations_package_name` - fully qualified name of the Python package
  containing the migrations.
- `up_to` - number of the last migration to apply.