There's some migration information in the new document system https://docs.developers.optimizely.com/content-cloud/v12.0.0-content-cloud/docs/aspnetidentity that's replaced the world docs.
A new version of episerver-identity is in testing that will automigrate the schema for you. For now you can see the script here here
We have decided instead to switch to using ApplicationUserManager and a claims-based approach to storing user information, since extending the user model at this time involves too much custom and risky database work.
Hello,
Is there any update on this subject. I find nothing on the internet about extend applicationuser. I can not migrate new field to database.
Does anyone have solution for this issue. for now we need to use custom table to store extra fields.
Thanks.
We're looking to extend the user model (ApplicationUser) with an extra field. Following the CMS docs here (https://world.optimizely.com/documentation/developer-guides/CMS/security/episerver-aspnetidentity/), we have this setup:
With this, however, during application start, we encounter the error "SqlException, invalid column name 'CustomData' ". Upon investigation, this is because in the database, the table dbo.AspNetUsers does not have the column CustomData created.
Going through the internet researching this, it seems like there is consensus that the documentation failed to detail the migration step: updating the database to reflect this new change:
With this in mind, when we go into the database and manually add the column to the AspNetUsers table, the error goes away as expected. But Optimizely obviously does not recommend interfering with the database schema, and our implementation will eventually be hosted on DXP.
We have opened a support ticket (#893747), and Optimizely is currently processing it, but we wanted to try and see if others on the forums have solved this issue before, and what's the best practice recommendation to solving this issue.