Giter VIP home page Giter VIP logo

Comments (2)

ifzc avatar ifzc commented on June 2, 2024

你好,白天没看到,久等😊

给你提供以下找问题思路:

  1. 如果是 CodeFirst 模式来创建数据库:
    首先删除 Migrations 文件夹下面的所有文件(这些文件是EF在执行 Add-Migration Initial 命令产生的,也相当于是每一次表结构变化的记录,不删除的话应该直接执行 Update-Database)
    那么打开程序包管理控制台,目标项目设置为 KeJian.Core.EntityFramework
    这时运行 Add-Migration Initial EF会在 Migrations 生成初始化文件
    运行 Update-Database 更新到数据库

  2. dotnet ef migrations add Initial 等同于 Add-Migration Initial
    dotnet ef database update 等同于 Update-Database
    同样要在 KeJian.Core.EntityFramework 项目下执行

  3. 如果是直接生成SQL语句(一些生产环境开发者没有直接操作数据库的权限)
    首先删除 Migrations 文件夹下面的所有文件
    然后执行 Script-Migration

  4. 这个是针对的MySql,针对SqlServer的有小的差异

  5. My SQL 部分版本(有坑),不允许程序 CodeFirst 直接创建数据库,需要先创建个数据库,其他不变

  6. 不确定会不会是这个 Database='kejian' 一般不需要单引号

比较啰嗦,互相学习😊

from kejian.core.api.

GuoYunZheSE avatar GuoYunZheSE commented on June 2, 2024

好的,谢谢,因为在centos上进行build,然后同时mac上没有PM就给我造成了很大的困扰,最后我选择了先在本地Publish再导出.dll到服务器方法解决了这个问题。

from kejian.core.api.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.