Fix review findings: scrub committed password, restore migration namespace, document Npgsql version constraint
This commit is contained in:
@@ -297,6 +297,7 @@ __pycache__/
|
|||||||
|
|
||||||
# Environment Secrets
|
# Environment Secrets
|
||||||
**/environment
|
**/environment
|
||||||
|
**/appsettings.Development.json
|
||||||
|
|
||||||
# local sqlite files
|
# local sqlite files
|
||||||
**/deepdrft.db*
|
**/deepdrft.db*
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.4" />
|
||||||
|
<!-- Npgsql 10.0.1 requires Microsoft.EntityFrameworkCore >= 10.0.4; keep in sync -->
|
||||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" />
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.4" />
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.4" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.4" />
|
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.4" />
|
||||||
|
|||||||
@@ -7,9 +7,16 @@ public class DeepDrftContextFactory : IDesignTimeDbContextFactory<DeepDrftContex
|
|||||||
{
|
{
|
||||||
public DeepDrftContext CreateDbContext(string[] args)
|
public DeepDrftContext CreateDbContext(string[] args)
|
||||||
{
|
{
|
||||||
|
// For 'dotnet ef' commands, set ConnectionStrings__DefaultConnection in your environment.
|
||||||
|
// Example: export ConnectionStrings__DefaultConnection="Host=localhost;Database=deepdrft_dev;Username=postgres;Password=yourpassword"
|
||||||
|
var connectionString = Environment.GetEnvironmentVariable("ConnectionStrings__DefaultConnection")
|
||||||
|
?? throw new InvalidOperationException(
|
||||||
|
"Set ConnectionStrings__DefaultConnection environment variable to run dotnet ef commands. " +
|
||||||
|
"Example: Host=localhost;Database=deepdrft_dev;Username=postgres;Password=yourpassword");
|
||||||
|
|
||||||
var optionsBuilder = new DbContextOptionsBuilder<DeepDrftContext>();
|
var optionsBuilder = new DbContextOptionsBuilder<DeepDrftContext>();
|
||||||
optionsBuilder.UseNpgsql("Host=localhost;Database=deepdrft_dev;Username=postgres;Password=postgres");
|
optionsBuilder.UseNpgsql(connectionString);
|
||||||
|
|
||||||
return new DeepDrftContext(optionsBuilder.Options);
|
return new DeepDrftContext(optionsBuilder.Options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
<!-- Npgsql 10.0.1 requires Microsoft.EntityFrameworkCore >= 10.0.4; keep in sync -->
|
||||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" />
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace DeepDrftWeb.Services.Migrations
|
namespace DeepDrftWeb.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(DeepDrftContext))]
|
[DbContext(typeof(DeepDrftContext))]
|
||||||
[Migration("20260518025102_Initial")]
|
[Migration("20260518025102_Initial")]
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace DeepDrftWeb.Services.Migrations
|
namespace DeepDrftWeb.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class Initial : Migration
|
public partial class Initial : Migration
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace DeepDrftWeb.Services.Migrations
|
namespace DeepDrftWeb.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(DeepDrftContext))]
|
[DbContext(typeof(DeepDrftContext))]
|
||||||
partial class DeepDrftContextModelSnapshot : ModelSnapshot
|
partial class DeepDrftContextModelSnapshot : ModelSnapshot
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
<!-- Npgsql 10.0.1 requires Microsoft.EntityFrameworkCore >= 10.0.4; keep in sync -->
|
||||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" />
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" />
|
||||||
<ProjectReference Include="..\DeepDrftModels\DeepDrftModels.csproj" />
|
<ProjectReference Include="..\DeepDrftModels\DeepDrftModels.csproj" />
|
||||||
<ProjectReference Include="..\DeepDrftWeb.Client\DeepDrftWeb.Client.csproj" />
|
<ProjectReference Include="..\DeepDrftWeb.Client\DeepDrftWeb.Client.csproj" />
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"Logging": {
|
|
||||||
"LogLevel": {
|
|
||||||
"Default": "Information",
|
|
||||||
"Microsoft.AspNetCore": "Warning",
|
|
||||||
"DeepDrftWeb.Client.Services.StreamingAudioPlayerService": "Debug"
|
|
||||||
},
|
|
||||||
"Console": {
|
|
||||||
"FormatterName": "simple",
|
|
||||||
"LogLevel": {
|
|
||||||
"Default": "Information"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"DetailedErrors": true,
|
|
||||||
"ApiUrls": {
|
|
||||||
"ContentApi": "http://localhost:54494/"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"DefaultConnection": "Host=localhost;Database=deepdrft_dev;Username=postgres;Password=postgres"
|
"DefaultConnection": "Host=localhost;Database=deepdrft_dev;Username=postgres;Password=REPLACE_IN_ENV"
|
||||||
},
|
},
|
||||||
"ApiUrls": {
|
"ApiUrls": {
|
||||||
"ContentApi": "http://localhost:12777/"
|
"ContentApi": "http://localhost:12777/"
|
||||||
|
|||||||
Reference in New Issue
Block a user