是否有命名 Entity Framework 迁移的最佳或推荐做法?
Is there a best or recommended practice for naming Entity Framework migrations?
使用 Entity Framework 代码优先迁移时,是否有为每个迁移选择名称的最佳做法?例如,每个名称可能包含版本号或对模型所做的更改或两者。
Add-Migration Added Manager.Employees
Add-Migration Add_Employee_ManagerId
Add-Migration version 2
Add-Migration v2_Add_Employee_ManagerId
对于为具有多个开发人员和许多迁移的项目选择好的命名策略有什么提示吗?
我找到了 similar question 但没有答案。
Microsoft 文档中指出:
The migration name can be used like a commit message in a version control system. For example, if I made changes to save customer reviews of products, I might choose something like AddProductReviews.
因此,根据他们提供的 AddProductReviews
示例,我认为 Upper Camel Case 是 Microsoft 推荐的。
https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/
使用 Entity Framework 代码优先迁移时,是否有为每个迁移选择名称的最佳做法?例如,每个名称可能包含版本号或对模型所做的更改或两者。
Add-Migration Added Manager.Employees
Add-Migration Add_Employee_ManagerId
Add-Migration version 2
Add-Migration v2_Add_Employee_ManagerId
对于为具有多个开发人员和许多迁移的项目选择好的命名策略有什么提示吗?
我找到了 similar question 但没有答案。
Microsoft 文档中指出:
The migration name can be used like a commit message in a version control system. For example, if I made changes to save customer reviews of products, I might choose something like AddProductReviews.
因此,根据他们提供的 AddProductReviews
示例,我认为 Upper Camel Case 是 Microsoft 推荐的。
https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/