1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-26 17:37:36 +01:00
bitwarden-server/util/SqlServerEFScaffold
Matt Bishop 27adaf59b4
[PM-1011] LaunchDarkly service (#2726)
* LaunchDarkly service

* Load file-based flag values, properly support offline only when self-host

* Simplify tests

* Use interface for LD settings

* Remove tests that will provide inconsistent results depending on machine setup and file fallback

* Fall back to offline mode more actively

* Drive fallback file path with setting
2023-03-02 14:04:23 -05:00
..
Migrations [SM-394] Secrets Manager (#2164) 2023-01-13 15:02:53 +01:00
Factories.cs [SM-394] Secrets Manager (#2164) 2023-01-13 15:02:53 +01:00
packages.lock.json [PM-1011] LaunchDarkly service (#2726) 2023-03-02 14:04:23 -05:00
README.MD [SM-394] Secrets Manager (#2164) 2023-01-13 15:02:53 +01:00
SqlServerEFScaffold.csproj [SM-394] Secrets Manager (#2164) 2023-01-13 15:02:53 +01:00

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