migrations: non_nullable_field Running migrations: Rendering model states... DONE Applying non_nullable_field.0001_initial... OK Applying non_nullable_field.0002_initial_data... OK
field homepage to author $ python manage.py migrate non_nullable_field Operations to perform: Apply all migrations: non_nullable_field Running migrations: Rendering model states... DONE Applying non_nullable_field.0003_author_homepage... OK
change the nullable field to non-nullable without a default ... Please select a fix: 1) Provide a one-off value ... 2) Ignore for now ... 3) Quit ... Select an option: 2 Migrations for 'non_nullable_field': 0005_not_null_constraint.py: - Alter field homepage on author
models.CharField(max_length=50) class Meta: db_table = 'rename_app_author' class Book(models.Model): title = models.CharField(max_length=50) author = models.ForeignKey('rename_app.Author') class Meta: db_table = 'rename_app_book'
# in new_app_name/models.py author = models.ForeignKey('new_app_name.Author') class Meta: db_table = 'rename_app_book' # Keep as is for now! # in new_app_name/migrations/0003_pin_db_tables.py and others dependencies = [('new_app_name', '0002_initial_data')]