在本地运行Azure Mobile Server项目 [英] Running Azure Mobile Server project locally

查看:155
本文介绍了在本地运行Azure Mobile Server项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地使用本地SQL数据库运行Azure Mobile Server项目。
我从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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆