关于实体框架数据库生成电源包
在更改 EF edmx 文件后,我尝试使用此包进行数据库迁移。 但我总是收到以下错误:
Creating [sg].[Addresses]...
Msg 2714, Level 16, State 6, Line 1
There is already an object named 'Addresses' in the database.
** An error was encountered during execution of batch. Exiting.
地址表肯定在数据库中,因为这是一个迁移脚本。我选择“生成迁移T-SQL.xaml(VS)”策略来生成数据库。为什么脚本没有解决这个问题?
I've tried using this pack to do database migration after I changed the EF edmx file.
But I always receive following error:
Creating [sg].[Addresses]...
Msg 2714, Level 16, State 6, Line 1
There is already an object named 'Addresses' in the database.
** An error was encountered during execution of batch. Exiting.
The addresses table is in database for sure, because this is a migration script. I selected "Generate Migration T-SQL.xaml (VS)" strategy for generating database. How come the script does not address this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它仍然应该位于您正在生成的单独的新数据库中......好吧......新数据库。这是迁移的事实仅意味着正在考虑(可能)移动现有数据/元数据。这并不意味着它会改变现有的数据库。
It should still be in a separate, new database that you are generating the... well... new database. The fact that it is a migration just means that existing data/metadata is being taken into account to (possibly) be moved. It does not mean it alters the existing database.