[DB] DbContext relations

This commit is contained in:
max
2025-02-02 23:33:00 +01:00
parent 0f6b2fec88
commit 2938e1311f
10 changed files with 71 additions and 22 deletions

View File

@@ -0,0 +1,23 @@
# EF Core database
## Add migration project
```csharp
options.UseSqlite("Data Source=dev-dotbased.db", c => c.MigrationsAssembly("PROJECT-NAME"));
```
## EF Tool
Add migration
```shell
dotnet ef migrations add MIGRATION-NAME --project PROJECT-NAME
```
Remove migrations
```shell
dotnet ef migrations remove --project PROJECT-NAME
```
Update database
```shell
dotnet ef database update --project PROJECT-NAME
```