From d7e1287e866232d77d63d526c7c14bd025926f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E5=8A=9B=E8=B1=AA?= <2900882185@qq.com> Date: Sun, 22 Dec 2024 18:48:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...01\347\247\273\346\226\207\344\273\266.md" | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 "\351\203\221\345\212\233\350\261\252/20241222--\347\224\237\346\210\220\350\277\201\347\247\273\346\226\207\344\273\266.md" diff --git "a/\351\203\221\345\212\233\350\261\252/20241222--\347\224\237\346\210\220\350\277\201\347\247\273\346\226\207\344\273\266.md" "b/\351\203\221\345\212\233\350\261\252/20241222--\347\224\237\346\210\220\350\277\201\347\247\273\346\226\207\344\273\266.md" new file mode 100644 index 0000000..0e8c082 --- /dev/null +++ "b/\351\203\221\345\212\233\350\261\252/20241222--\347\224\237\346\210\220\350\277\201\347\247\273\346\226\207\344\273\266.md" @@ -0,0 +1,24 @@ +### 生成迁移文件 +```c# +dotnet ef migrations add FirstInit +``` +### 前提条件:安装必要的依赖包:**Design 依赖包** +安装命令: +```c# +dotnet add package Microsoft.EntityFrameworkCore.Design +``` +- 全局工具包 (dotnet-ef) +```C# +dotnet tool install --global dotnet-ef +``` +### 要求: +1. 确保程序没有编译错误,可运行以下命令检查: +```C# +dotnet build +``` +2. 确保程序未处于运行状态 + +### 同步迁移文件到数据库 +```C# +dotnet ef database update +``` \ No newline at end of file -- Gitee