修改数据库迁移脚本

This commit is contained in:
hello 2025-03-25 15:24:22 +08:00
parent 0b1c871c7e
commit 4443d55057

View File

@ -18,7 +18,7 @@ dotnet ef database update
await dbContext.Database.EnsureCreatedAsync(); await dbContext.Database.EnsureCreatedAsync();
``` ```
`EnsureCreatedAsync` 会创建数据库,并会创建所有表,但不会应用迁移脚本,适用于开发环境。 `EnsureCreatedAsync` 会创建数据库(如果不存在),并会创建所有表,但不会应用迁移脚本,适用于开发环境。
## 使用代码将最新迁移脚本应用到数据库 ## 使用代码将最新迁移脚本应用到数据库