When I am updating model properties then it is not reflecting directly in table, First I need to delete the old table and run the project then it creates new table with changes.
I there any way to migrate changes in table without deleting the table.
This works only when i create migration script manually but i want the way to create migration script dynamically [add-migration] same as entity frame work in mvc approach. In MVC approach there is an option in manage console to create migration script by [add-migration].
How to set GUID as primary key in peta poco apprach
Hi
I am using peta poco but no idea how to set primary and foreign key as GUID.
Thanks
Hi Manish,
on your class you can use an attribute to set your PrimaryKey:
So your primary key would be named Id and is of type Guid.
That should work.
Regards David
Many thanks David B :)
When I am updating model properties then it is not reflecting directly in table, First I need to delete the old table and run the project then it creates new table with changes. I there any way to migrate changes in table without deleting the table.
Thanks
Hi Manish,
have a look at umbraco migrations. Basically a class inheriting from MigrationBase.
With that you have an up/down method where you can do changes on your tables.
https://cultiv.nl/blog/using-umbraco-migrations-to-deploy-changes/
Regards David
This works only when i create migration script manually but i want the way to create migration script dynamically [add-migration] same as entity frame work in mvc approach. In MVC approach there is an option in manage console to create migration script by [add-migration].
I want approach something like this https://docs.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/migrations-and-deployment-with-the-entity-framework-in-an-asp-net-mvc-application
Please suggest on above query.
Thanks
Hi Manish,
that's not possible in Umbraco. You have to create the migrations by hand.
Regards David
is working on a reply...