AI did some stuff

This commit is contained in:
moarten
2026-03-26 21:40:11 +01:00
parent 0774281cbc
commit 5697cba8d4
13 changed files with 465 additions and 12 deletions

View 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
}
}
}

View File

@@ -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");
}
}
}

View File

@@ -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
}
}
}