Complete the code to create a new migration for your Django app.
python manage.py [1]Use makemigrations to create new migration files based on model changes.
Complete the code to apply all pending migrations to the database.
python manage.py [1]The migrate command applies migrations to update the database schema.
Fix the error in the migration command to specify the app name.
python manage.py makemigrations [1]Specify your app name (e.g., myapp) to create migrations only for that app.
Fill both blanks to create a migration that adds a new field to a model.
class Migration(migrations.Migration): dependencies = [ ('[1]', '0001_initial'), ] operations = [ migrations.AddField( model_name='[2]', name='new_field', field=models.CharField(max_length=100), ), ]
model_name.The dependencies list must include the app name and previous migration. The model_name is the model receiving the new field.
Fill all three blanks to write a migration that removes a field from a model.
class Migration(migrations.Migration): dependencies = [ ('[1]', '0002_auto_20240101_1234'), ] operations = [ migrations.RemoveField( model_name='[2]', name='[3]', ), ]
The dependencies specify the app and migration to depend on. The model_name is the model to change, and name is the field to remove.