I am new to fluent Migrations. I want to simply delete a row from the database can you please guide me how this can be done. or point me out in the right direction if this questions is already answered elsewhere on stackoverflow. I dont want to use the dynamic sql in the migration script.
thanks.
To delete a row in your migration just do the following:
//Delete all rows where MyColumn = 123
Delete.FromTable("MyTable").Row(new { MyColumn = "123" }); 
The documentation for FluentMigrator is a great place for questions like this. The article you're looking for can be found here.
I found the answer from the wiki . below is the format which can be used to do the migration for deleting row from the database
Delete.FromTable("Users").Row(new { FirstName = "John" }); // delete all rows with FirstName==John
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With