1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-01 13:43:23 +01:00
bitwarden-server/util/SqlServerEFScaffold/README.MD
Oscar Hinton 1f0fc43278
[SM-394] Secrets Manager (#2164)
Long lived feature branch for Secrets Manager

Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>
Co-authored-by: cd-bitwarden <106776772+cd-bitwarden@users.noreply.github.com>
Co-authored-by: CarleyDiaz-Bitwarden <103955722+CarleyDiaz-Bitwarden@users.noreply.github.com>
Co-authored-by: Thomas Avery <tavery@bitwarden.com>
Co-authored-by: Colton Hurst <colton@coltonhurst.com>
2023-01-13 15:02:53 +01:00

27 lines
1010 B
Markdown

## Usage
The SqlServerEFScaffold project is intended to be used as a tool for developers to validate their Microsoft SQL Server database changes and Infrastructure.EntityFramework.Models stay in sync for entity framework MS SQL Server repositories.
## Check Infrastructure.EntityFramework.Models (Database First)
Run the following:
```dotnet ef dbcontext scaffold "<local db connection string>" Microsoft.EntityFrameworkCore.SqlServer -o Model```
The dotnet entity framework command will generate models from the local database provided.
Engineers can reference these models and validate they match with Infrastructure.EntityFramework.Models.
## Check Microsoft SQL Server Database changes (Code/Model First)
Run the following:
```
dotnet ef migrations add Init
dotnet ef migrations script
```
This will generate a SQL script to initialize a database based on the models in Infrastructure.EntityFramework.Models.
This is helpful to check against the proposed database changes provided in /src/SQL