It's "let's answer really old questions" time!
Below info taken from the current-as-of-now django 3.0 docs
Your migration function will take a second argument which is a SchemaEditor
object. This gives you the database for your commands.
def forwards_func(apps, schema_editor):
# We get the model from the versioned app registry;
# if we directly import it, it'll be the wrong version
Country = apps.get_model("myapp", "Country")
db_alias = schema_editor.connection.alias
Country.objects.using(db_alias).bulk_create([
Country(name="USA", code="us"),
Country(name="France", code="fr"),
])