Error While Enabling Code-First Migrations On Mobile Services Database

前端 未结 5 1762
你的背包
你的背包 2021-02-07 17:12

I have an Azure Mobile Services project (C# backend) that I recently created and attached to an Azure SQL database. I have been trying to enable Code-First Migrations on that ba

5条回答
  •  無奈伤痛
    2021-02-07 18:01

    If you are getting this error on update-database after creating the migration class, Then have a look @ your migration class. The migration class will take primary is clustered index. So remove that from the up() method.

    .PrimaryKey(t => t.Id, clustered: false) .Index(t => t.CreatedAt, clustered: true);

    If you using it on azure mobile service, do not call 'update-database' manually. refer http://azure.microsoft.com/en-in/documentation/articles/mobile-services-dotnet-backend-how-to-use-code-first-migrations/

提交回复
热议问题