在练习Mvc项目时,提示如下数据库错误:

The model backing the 'EFDbContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).

按上述链接要求,在程序包管理控制台执行:Enable-Migrations 后,

生成对应DAL目录内生成 Mirgrations新目录,

再执行 Update-Database, 提示

Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
No pending explicit migrations.
Unable to update database to match the current model because there are pending changes and automatic migration is disabled. Either write the pending model changes to a code-based migration or enable automatic migration. Set DbMigrationsConfiguration.AutomaticMigrationsEnabled to true to enable automatic migration.
You can use the Add-Migration command to write the pending model changes to a code-based migration.

项目仍无法连接数据库,

后直接清除数据库内的 [__MigrationHistory]表数据,

问题成功解决。

最新文章

  1. nginx + tomcat配置负载均衡
  2. AngularJS 1.2.x 学习笔记(表单校验篇)
  3. windows下mongodb安装与使用整理
  4. viewpager接受值图片轮播
  5. android中的EditView控件
  6. 来试试这个来自静态代码分析工具PVS Studio提供C++的小测验吧
  7. web前端笔记整理一---HTML
  8. PHP中字符串与html相互转化函数
  9. Linux内核分析——Linux内核学习总结
  10. Python——scapy模块实现tcp探测目标服务器路由轨迹
  11. 服务网关Zuul
  12. python标准库介绍——18 StringIO 模块详解
  13. Vivado&ISE&Quartus II调用Modelsim级联仿真
  14. 《深入理解Java虚拟机》笔记--第十三章、线程安全与锁优化
  15. Java进阶2 数组内存和对象的内存管理知识
  16. 【2018多校第一场】hdu6308-Time Zone(日期)
  17. Tkinter Menu(菜单)
  18. Spring_通过注解配置 Bean(1)
  19. Sql Server中一次更新多列数据
  20. Django-03

热门文章

  1. windows下搭建vue开发环境+IIS部署
  2. 把 Nginx 创建为 Windows 的一个服务
  3. tomcat无法正常关闭问题分析及解决
  4. [再寄小读者之数学篇](2014-04-18 from 352558840@qq.com [南开大学 2014 年高等代数考研试题]反对称矩阵的组合)
  5. 版本控制工具 - Git
  6. 重新定义Pytorch中的TensorDataset,可实现transforms
  7. Beta冲刺(1/7)
  8. 【原创】大叔问题定位分享(18)beeline连接spark thrift有时会卡住
  9. vue app混合开发蓝牙串口连接(报错java.io.IOException: read failed, socket might closed or timeout, read ret: -1;at android.bluetooth.BluetoothSocket.connect at js/BluetoothTool.js:329)
  10. About the Mean Shift