在本地运行Azure Mobile Server项目 [英] Running Azure Mobile Server project locally
问题描述
我从Quickstart项目开始,但是一旦将Entity更改为更复杂的内容,我的迁移就会收到此错误:
无法在表上创建多个聚簇索引
即使使用正确的模式,我也得到另一个错误:
不支持影响迁移历史记录系统表的位置的自动迁移(例如默认模式更改)。请对影响位置的操作使用基于代码的迁移迁移历史系统表。
如果您使用迁移,那么EF有机会尝试将主键和CreatedAt列同时创建为聚簇索引。如果你告诉迁移使用Azure Mobile Services / Apps SqlGenerator,它应该做正确的事情。
看看我的答案是否此处修复了您的问题。
I'm running an Azure Mobile Server project locally with a local SQL Database. I started from the Quickstart project, but as soon as I change the Entity to something more complex, I get this error with my migration:
"Cannot create more than one clustered index on table..."
Even with the correct schema I get this other error:
"Automatic migrations that affect the location of the migrations history system table (such as default schema changes) are not supported. Please use code-based migrations for operations that affect the location of the migrations history system table."
If you're using migrations, there's a chance that EF is trying to create both the primary key and CreatedAt column as clustered indexes. If you tell the migration to use the Azure Mobile Services/Apps SqlGenerator, it should do the right thing.
See if my answer here fixes the issue for you.
这篇关于在本地运行Azure Mobile Server项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!