I have a column IsPrivate which was originally tiny int but I decided to change it to bool
PM> add-migration MigrationName results to
AlterColumn("dbo.Jobs", "IsPrivate", c => c.Boolean(nullable: false));
When I run update-database, I got an error
The object 'DF__Jobs__IsPrivate__52E34C9D' is dependent on column 'IsPrivate'.
ALTER TABLE ALTER COLUMN IsPrivate failed because one or more objects access this column.
It’s because IsPrivate column has default constraint DF__Jobs__IsPrivate__52E34C9D so I need to manually add code to drop it
Sql("ALTER TABLE dbo.Jobs DROP CONSTRAINT DF__Jobs__IsPrivate__52E34C9D");
AlterColumn("dbo.Jobs", "IsPrivate", c => c.Boolean(nullable: false));
When I run update-database again, this time it’s successful