Compare commits
2 Commits
main
...
569cfbb85d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
569cfbb85d | ||
|
|
5697cba8d4 |
104
Lutra/.github/copilot-instructions.md
vendored
Normal file
104
Lutra/.github/copilot-instructions.md
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
# Copilot Instructions for Lutra
|
||||
|
||||
Use these standards when generating or modifying code in this repository.
|
||||
|
||||
## Project overview
|
||||
|
||||
- Target framework: .NET 10 (`net10.0`)
|
||||
- Architecture: Clean Architecture
|
||||
- Solution layers:
|
||||
- `Lutra.Domain`
|
||||
- `Lutra.Application`
|
||||
- `Lutra.Infrastructure.Sql`
|
||||
- `Lutra.API`
|
||||
- `Lutra.AppHost`
|
||||
- `Lutra.Infrastructure.Migrator`
|
||||
- Database: PostgreSQL via EF Core
|
||||
- Orchestration: .NET Aspire
|
||||
- Messaging pattern: `Cortex.Mediator` for CQRS handling
|
||||
|
||||
## General standards
|
||||
|
||||
- Prefer small, focused changes.
|
||||
- Follow existing naming, formatting, and folder conventions.
|
||||
- Keep dependencies pointing inward:
|
||||
- Domain depends on nothing
|
||||
- Application depends on Domain
|
||||
- Infrastructure depends on Application and Domain
|
||||
- API depends on Application and Infrastructure
|
||||
- AppHost and Migrator are host projects only
|
||||
- Use nullable reference types correctly and keep implicit usings compatible with the project style.
|
||||
|
||||
## Clean Architecture guidance
|
||||
|
||||
Use Jason Taylor’s CleanArchitecture project as a reference for intent and structure, but adapt to this codebase’s actual implementation.
|
||||
|
||||
Where the reference template uses MediatR, this project uses `Cortex.Mediator`.
|
||||
Add FluentValidation, AutoMapper, NUnit, Shouldly, Moq, or Respawn only if the repository already uses them or the change clearly requires them.
|
||||
|
||||
## Domain layer rules
|
||||
|
||||
- Keep entities simple and focused on business state.
|
||||
- Use `BaseEntity` as the shared base type when appropriate.
|
||||
- Preserve the current entity style:
|
||||
- `Id` as `Guid`
|
||||
- audit fields like `CreatedAt`, `ModifiedAt`, `DeletedAt`
|
||||
- `IsDeleted` as a derived property
|
||||
- Keep validation and persistence concerns out of Domain unless they are intrinsic business rules.
|
||||
|
||||
## Application layer rules
|
||||
|
||||
- Put use cases in feature folders.
|
||||
- Follow the existing CQRS split:
|
||||
- `FeatureName.cs` as the partial entry point
|
||||
- `FeatureName.Query.cs` or `FeatureName.Command.cs`
|
||||
- `FeatureName.Handler.cs`
|
||||
- `FeatureName.Response.cs`
|
||||
- Use `Cortex.Mediator` request and handler interfaces.
|
||||
- Keep handlers focused on orchestration and application logic.
|
||||
- Use `ILutraDbContext` rather than referencing the concrete DbContext directly when possible.
|
||||
|
||||
## Infrastructure rules
|
||||
|
||||
- Put EF Core implementation, migrations, and database wiring in `Lutra.Infrastructure.Sql`.
|
||||
- Keep the DbContext implementation aligned with `ILutraDbContext`.
|
||||
- If package versions must be pinned for runtime compatibility, pin them explicitly in the infrastructure project.
|
||||
- Be cautious with `PrivateAssets="all"` on design-time packages because they do not flow dependency constraints to downstream projects.
|
||||
|
||||
## API layer rules
|
||||
|
||||
- Keep controllers thin.
|
||||
- Controllers should delegate to Application use cases through `IMediator`.
|
||||
- Keep `Program.cs` focused on DI and middleware setup.
|
||||
|
||||
## Aspire and migration rules
|
||||
|
||||
- Keep `Lutra.AppHost` responsible for orchestration only.
|
||||
- Preserve the persistent PostgreSQL container setup unless a change explicitly requires otherwise.
|
||||
- Keep the migrator as a one-shot project that applies migrations on startup.
|
||||
- Ensure migration-related changes do not break runtime assembly/version consistency.
|
||||
|
||||
## Naming and code style
|
||||
|
||||
- Match the existing language of the codebase; this project uses Dutch domain names in places such as `Verspakketten`, `Supermarkt`, and `Beoordeling`.
|
||||
- Keep class and file names consistent with the feature name.
|
||||
- Use sealed types where the project already does.
|
||||
- Prefer explicit `required` members where the current codebase uses them.
|
||||
- Preserve current indentation and brace style in each file.
|
||||
|
||||
## Testing guidance
|
||||
|
||||
- If tests exist, update or add tests alongside behavior changes.
|
||||
- Follow the reference template’s intent for test coverage:
|
||||
- unit tests for business logic
|
||||
- integration tests for infrastructure and data access
|
||||
- functional tests for API behavior
|
||||
- Keep tests readable and focused on behavior.
|
||||
|
||||
## When making changes
|
||||
|
||||
- Read the relevant file before editing.
|
||||
- Make the smallest change that solves the problem.
|
||||
- Reuse existing patterns from the repo instead of inventing new ones.
|
||||
- Run or request a build/test verification after changes when appropriate.
|
||||
- Avoid broad refactors unless the user asks for them.
|
||||
@@ -11,7 +11,12 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Cortex.Mediator" Version="3.1.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
|
||||
<ProjectReference Include="..\Lutra.Infrastructure\Lutra.Infrastructure.Sql.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
|
||||
using Cortex.Mediator.DependencyInjection;
|
||||
using Lutra.Application.Verspakketten;
|
||||
using Lutra.Application.Interfaces;
|
||||
using Lutra.Infrastructure.Sql;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Lutra.API
|
||||
{
|
||||
@@ -15,6 +18,9 @@ namespace Lutra.API
|
||||
options => options.AddDefaultBehaviors()
|
||||
);
|
||||
|
||||
builder.Services.AddDbContext<ILutraDbContext, LutraDbContext>(options =>
|
||||
options.UseNpgsql(builder.Configuration.GetConnectionString("LutraDb")));
|
||||
|
||||
builder.Services.AddControllers();
|
||||
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
|
||||
builder.Services.AddOpenApi();
|
||||
|
||||
@@ -5,5 +5,8 @@
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"LutraDb": "Host=db.m91.nl;Username=user;Password=password;Database=Lutra"
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
var builder = DistributedApplication.CreateBuilder(args);
|
||||
|
||||
var sql = builder.AddSqlServer("sql")
|
||||
.WithLifetime(ContainerLifetime.Persistent);
|
||||
var postgres = builder.AddPostgres("postgres")
|
||||
.WithDataVolume()
|
||||
.WithLifetime(ContainerLifetime.Persistent);
|
||||
|
||||
var db = sql.AddDatabase("database", "Lutra");
|
||||
var db = postgres
|
||||
.AddDatabase("LutraDb");
|
||||
|
||||
var migrator = builder.AddProject<Projects.Lutra_Infrastructure_Migrator>("dbmigrator")
|
||||
.WithReference(db)
|
||||
.WaitFor(db);
|
||||
|
||||
var apiService = builder.AddProject<Projects.Lutra_API>("apiservice")
|
||||
.WithHttpHealthCheck("/health")
|
||||
.WithReference(db)
|
||||
.WaitFor(db);
|
||||
.WaitForCompletion(migrator);
|
||||
|
||||
builder.Build().Run();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Sdk Name="Aspire.AppHost.Sdk" Version="9.5.0" />
|
||||
|
||||
@@ -11,12 +11,13 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Aspire.Hosting.AppHost" Version="13.1.3" />
|
||||
<PackageReference Include="Aspire.Hosting.SqlServer" Version="13.1.3" />
|
||||
<PackageReference Include="Aspire.Hosting.AppHost" Version="13.2.1" />
|
||||
<PackageReference Include="Aspire.Hosting.PostgreSQL" Version="13.2.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Lutra.API\Lutra.API.csproj" />
|
||||
<ProjectReference Include="..\Lutra.Infrastructure.Migrator\Lutra.Infrastructure.Migrator.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="10.0.5" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Lutra.Infrastructure\Lutra.Infrastructure.Sql.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
16
Lutra/Lutra.Infrastructure.Migrator/Program.cs
Normal file
16
Lutra/Lutra.Infrastructure.Migrator/Program.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Lutra.Infrastructure.Sql;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
var builder = Host.CreateApplicationBuilder(args);
|
||||
|
||||
builder.Services.AddDbContext<LutraDbContext>(options =>
|
||||
options.UseNpgsql(builder.Configuration.GetConnectionString("LutraDb")));
|
||||
|
||||
using var host = builder.Build();
|
||||
using var scope = host.Services.CreateScope();
|
||||
|
||||
var dbContext = scope.ServiceProvider.GetRequiredService<LutraDbContext>();
|
||||
await dbContext.Database.MigrateAsync();
|
||||
@@ -8,6 +8,12 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.5" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,14 +4,21 @@ using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Lutra.Infrastructure.Sql;
|
||||
|
||||
public class LutraDbContext : ILutraDbContext
|
||||
public class LutraDbContext : DbContext, ILutraDbContext
|
||||
{
|
||||
public DbSet<Supermarkt> Supermarkten => throw new NotImplementedException();
|
||||
|
||||
public DbSet<Verspakket> Verspaketten => throw new NotImplementedException();
|
||||
|
||||
public Task<int> SaveChangesAsync(CancellationToken cancellationToken)
|
||||
public LutraDbContext(DbContextOptions<LutraDbContext> options)
|
||||
: base(options)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public DbSet<Supermarkt> Supermarkten => Set<Supermarkt>();
|
||||
|
||||
public DbSet<Verspakket> Verspaketten => Set<Verspakket>();
|
||||
|
||||
public DbSet<Beoordeling> Beoordelingen => Set<Beoordeling>();
|
||||
|
||||
public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
return base.SaveChangesAsync(cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
149
Lutra/Lutra.Infrastructure/Migrations/20260326190730_InitialCreate.Designer.cs
generated
Normal file
149
Lutra/Lutra.Infrastructure/Migrations/20260326190730_InitialCreate.Designer.cs
generated
Normal file
@@ -0,0 +1,149 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Lutra.Infrastructure.Sql;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Lutra.Infrastructure.Sql.Migrations
|
||||
{
|
||||
[DbContext(typeof(LutraDbContext))]
|
||||
[Migration("20260326190730_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "10.0.5")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Lutra.Domain.Entities.Beoordeling", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<bool>("Aanbevolen")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("CijferBereiden")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("CijferSmaak")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Tekst")
|
||||
.HasMaxLength(1024)
|
||||
.HasColumnType("character varying(1024)");
|
||||
|
||||
b.Property<Guid?>("VerspakketId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("VerspakketId");
|
||||
|
||||
b.ToTable("Beoordelingen");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lutra.Domain.Entities.Supermarkt", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Naam")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Supermarkten");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lutra.Domain.Entities.Verspakket", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("AantalPersonen")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Naam")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.Property<Guid>("SupermarktId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SupermarktId");
|
||||
|
||||
b.ToTable("Verspaketten");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lutra.Domain.Entities.Beoordeling", b =>
|
||||
{
|
||||
b.HasOne("Lutra.Domain.Entities.Verspakket", null)
|
||||
.WithMany("Beoordelingen")
|
||||
.HasForeignKey("VerspakketId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lutra.Domain.Entities.Verspakket", b =>
|
||||
{
|
||||
b.HasOne("Lutra.Domain.Entities.Supermarkt", "Supermarkt")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupermarktId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Supermarkt");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lutra.Domain.Entities.Verspakket", b =>
|
||||
{
|
||||
b.Navigation("Beoordelingen");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Lutra.Infrastructure.Sql.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialCreate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Supermarkten",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Naam = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Supermarkten", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Verspaketten",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Naam = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
|
||||
AantalPersonen = table.Column<int>(type: "integer", nullable: false),
|
||||
SupermarktId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Verspaketten", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Verspaketten_Supermarkten_SupermarktId",
|
||||
column: x => x.SupermarktId,
|
||||
principalTable: "Supermarkten",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Beoordelingen",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
CijferSmaak = table.Column<int>(type: "integer", nullable: false),
|
||||
CijferBereiden = table.Column<int>(type: "integer", nullable: false),
|
||||
Aanbevolen = table.Column<bool>(type: "boolean", nullable: false),
|
||||
Tekst = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
||||
VerspakketId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
DeletedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Beoordelingen", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Beoordelingen_Verspaketten_VerspakketId",
|
||||
column: x => x.VerspakketId,
|
||||
principalTable: "Verspaketten",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Beoordelingen_VerspakketId",
|
||||
table: "Beoordelingen",
|
||||
column: "VerspakketId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Verspaketten_SupermarktId",
|
||||
table: "Verspaketten",
|
||||
column: "SupermarktId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Beoordelingen");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Verspaketten");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Supermarkten");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Lutra.Infrastructure.Sql;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Lutra.Infrastructure.Sql.Migrations
|
||||
{
|
||||
[DbContext(typeof(LutraDbContext))]
|
||||
partial class LutraDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "10.0.5")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Lutra.Domain.Entities.Beoordeling", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<bool>("Aanbevolen")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("CijferBereiden")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("CijferSmaak")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Tekst")
|
||||
.HasMaxLength(1024)
|
||||
.HasColumnType("character varying(1024)");
|
||||
|
||||
b.Property<Guid?>("VerspakketId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("VerspakketId");
|
||||
|
||||
b.ToTable("Beoordelingen");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lutra.Domain.Entities.Supermarkt", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Naam")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Supermarkten");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lutra.Domain.Entities.Verspakket", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("AantalPersonen")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Naam")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.Property<Guid>("SupermarktId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SupermarktId");
|
||||
|
||||
b.ToTable("Verspaketten");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lutra.Domain.Entities.Beoordeling", b =>
|
||||
{
|
||||
b.HasOne("Lutra.Domain.Entities.Verspakket", null)
|
||||
.WithMany("Beoordelingen")
|
||||
.HasForeignKey("VerspakketId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lutra.Domain.Entities.Verspakket", b =>
|
||||
{
|
||||
b.HasOne("Lutra.Domain.Entities.Supermarkt", "Supermarkt")
|
||||
.WithMany()
|
||||
.HasForeignKey("SupermarktId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Supermarkt");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lutra.Domain.Entities.Verspakket", b =>
|
||||
{
|
||||
b.Navigation("Beoordelingen");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lutra.Infrastructure.Sql",
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lutra.AppHost", "Lutra.AppHost\Lutra.AppHost.csproj", "{B9B41350-EB18-4564-81AB-C16F3E5A0CBB}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lutra.Infrastructure.Migrator", "Lutra.Infrastructure.Migrator\Lutra.Infrastructure.Migrator.csproj", "{6582486C-CEB7-78BF-D043-E0C3C0D6A923}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -39,6 +41,10 @@ Global
|
||||
{B9B41350-EB18-4564-81AB-C16F3E5A0CBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B9B41350-EB18-4564-81AB-C16F3E5A0CBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B9B41350-EB18-4564-81AB-C16F3E5A0CBB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6582486C-CEB7-78BF-D043-E0C3C0D6A923}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6582486C-CEB7-78BF-D043-E0C3C0D6A923}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6582486C-CEB7-78BF-D043-E0C3C0D6A923}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6582486C-CEB7-78BF-D043-E0C3C0D6A923}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user