Migration trong Entity Framework là gì?
Migration trong Entity Framework là gì?
Migrations quản lý thay đổi schema CSDL theo thời gian bằng các file code có phiên bản, đồng bộ với model C#.
dotnet tool install --global dotnet-ef
dotnet ef migrations add AddProductPrice # sinh file migration từ thay đổi model
dotnet ef database update # áp dụng vào DB
dotnet ef database update PreviousMigration # quay lui
dotnet ef migrations script --idempotent -o deploy.sql # script cho CI/CD
dotnet ef migrations remove
public partial class AddProductPrice : Migration
Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.