I\'m migrating my site from an SQLite backend to a Postgres backend. We\'ve been running native-Django style migrations (i.e., not South) from the beginning of the project. Most
The problem is the migration from Process.milestone as a boolean field to Process.milestone as a foreign key. Postgres doesn't wait for a migration to fail on uncastable data. It wants a rule to alter the table in advance.
If you don't intend any sort of data migration between two fields, the easiest option is to simply drop and add the field. In this specific case, it would mean changing the operations as follows:
operations = [
migrations.RemoveField(
model_name='process',
name='milestone'
),
migrations.AddField(
model_name='process',
name='milestone',
field=models.ForeignKey(to='processes.Milestone'),
),
migrations.AlterModelOptions(
name='process',
options={'ordering': ['milestone', 'sequence'], 'verbose_name_plural': 'processes'},
)
]