Refactor namespaces to follow new naming convention and add item model classes
This commit is contained in:
42
DATABASE.md
Normal file
42
DATABASE.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# Database Setup and Migration Guide
|
||||
|
||||
## Prerequisites
|
||||
- .NET 8.0 SDK
|
||||
- Entity Framework Core tools
|
||||
|
||||
## Install EF Core Tools
|
||||
```sh
|
||||
dotnet tool install --global dotnet-ef
|
||||
```
|
||||
|
||||
### Creating and Updating Database
|
||||
1. Create initial migration:
|
||||
dotnet ef migrations add InitialCreate
|
||||
|
||||
2. Apply migrations to create/update database:
|
||||
dotnet ef database update
|
||||
|
||||
### Common Commands
|
||||
1. Create new migration:
|
||||
dotnet ef migrations add <MigrationName>
|
||||
|
||||
2. Remove last migration:
|
||||
dotnet ef migrations remove
|
||||
|
||||
3. Apply migrations to create/update database:
|
||||
dotnet ef database update
|
||||
|
||||
4. Revert last migration:
|
||||
dotnet ef database update <MigrationName>
|
||||
|
||||
5. List all migrations:
|
||||
dotnet ef migrations list
|
||||
|
||||
6. Script migration:
|
||||
dotnet ef migrations script
|
||||
|
||||
7. Remove all migrations:
|
||||
dotnet ef migrations remove
|
||||
|
||||
8. Drop database:
|
||||
dotnet ef database drop
|
||||
Reference in New Issue
Block a user