https://github.com/arnab-developer/efmigrations
An example application with EF Migrations
https://github.com/arnab-developer/efmigrations
Last synced: 8 months ago
JSON representation
An example application with EF Migrations
- Host: GitHub
- URL: https://github.com/arnab-developer/efmigrations
- Owner: Arnab-Developer
- License: mit
- Created: 2021-03-12T09:19:25.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-21T07:42:44.000Z (about 5 years ago)
- Last Synced: 2025-01-17T02:24:17.444Z (over 1 year ago)
- Language: C#
- Size: 663 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EF Migrations demo
An example ASP.NET application with EF Migrations following below doc
https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli
I have used two databases for this app. One is for dev env and another is for prd env. To create and
update dev database, I have used EF Migrations (add migrations and update database). To create and
update prd database, I have generated script through EF Migrations and executed in prd database during
the deployment.
## Initial create
For dev env
```
dotnet ef migrations add InitialCreate
dotnet ef database update
```
For prd env
```
dotnet ef migrations script
```
Copy the generated script from terminal and executed in prd database.
## Add student subject
For dev env
```
dotnet ef migrations add AddStudentSubject
dotnet ef database update
```
For prd env
```
dotnet ef migrations script InitialCreate
```
Copy the generated script from terminal and executed in prd database.