Files
openwaf/dotnet/OpenWaf.Infrastructure/Persistence/Migrations/OpenWafDbContextModelSnapshot.cs
T
Pavlo Ratushnyi 565da4fab5 Add EF Core migrations; make schema strategy explicit
- dotnet-ef 10.0.0 as a local tool manifest, InitialCreate generated against
  PostgreSQL (the provider a real deployment runs) via a design-time factory,
  so migrations never need to boot the edge
- EdgeStateWarmer picks the strategy: migrate for postgres, ensurecreated for
  the sqlite default, none when the operator owns the schema. A migration set
  is provider-shaped SQL and is not applied across providers
- README documents the schema story

Regressions checked: 36 unit + 14 integration tests, scripts/smoke.sh 19/19.
2026-10-01 02:32:12 +02:00

258 lines
9.3 KiB
C#

// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using OpenWaf.Infrastructure.Persistence;
#nullable disable
namespace OpenWaf.Infrastructure.Persistence.Migrations
{
[DbContext(typeof(OpenWafDbContext))]
partial class OpenWafDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("OpenWaf.Domain.Policy.CountryRule", b =>
{
b.Property<string>("Code")
.HasMaxLength(2)
.HasColumnType("character varying(2)");
b.Property<bool>("IsAllowed")
.HasColumnType("boolean");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Code");
b.ToTable("country_rules", (string)null);
});
modelBuilder.Entity("OpenWaf.Domain.Security.AllowEntry", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset?>("ExpiresAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Match")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Note")
.HasMaxLength(512)
.HasColumnType("character varying(512)");
b.HasKey("Id");
b.HasIndex("Match")
.IsUnique();
b.ToTable("allow_entries", (string)null);
});
modelBuilder.Entity("OpenWaf.Domain.Security.BlockEntry", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<int?>("ConsecutiveRefusals")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset?>("ExpiresAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("LastCity")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("LastCountryCode")
.HasMaxLength(2)
.HasColumnType("character varying(2)");
b.Property<string>("LastPath")
.HasMaxLength(512)
.HasColumnType("character varying(512)");
b.Property<string>("LastRegion")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<int?>("LastStatusCode")
.HasColumnType("integer");
b.Property<string>("LastUserAgent")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("Reason")
.HasMaxLength(1024)
.HasColumnType("character varying(1024)");
b.Property<string>("RedirectTo")
.HasMaxLength(512)
.HasColumnType("character varying(512)");
b.Property<int>("Source")
.HasColumnType("integer");
b.Property<string>("SourceKey")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.HasKey("Id");
b.HasIndex("ExpiresAt");
b.HasIndex("SourceKey", "Source")
.IsUnique();
b.ToTable("block_entries", (string)null);
});
modelBuilder.Entity("OpenWaf.Domain.Security.EdgeAlert", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<int>("Count")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Detail")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)");
b.Property<string>("Kind")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<string>("LastPath")
.HasColumnType("text");
b.Property<int?>("LastStatusCode")
.HasColumnType("integer");
b.Property<string>("SourceKey")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.ToTable("edge_alerts", (string)null);
});
modelBuilder.Entity("OpenWaf.Domain.Security.SourceObservation", b =>
{
b.Property<string>("SourceKey")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<DateTimeOffset>("FirstSeenAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("LastCity")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("LastCountryCode")
.HasMaxLength(2)
.HasColumnType("character varying(2)");
b.Property<string>("LastPath")
.HasMaxLength(512)
.HasColumnType("character varying(512)");
b.Property<string>("LastRegion")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<DateTimeOffset>("LastSeenAt")
.HasColumnType("timestamp with time zone");
b.Property<int?>("LastStatusCode")
.HasColumnType("integer");
b.Property<string>("LastUserAgent")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<int>("MaxConsecutiveRefusals")
.HasColumnType("integer");
b.Property<int>("TotalRefusals")
.HasColumnType("integer");
b.Property<int>("TotalServerErrorStreak")
.HasColumnType("integer");
b.HasKey("SourceKey");
b.HasIndex("LastSeenAt");
b.ToTable("source_observations", (string)null);
});
modelBuilder.Entity("OpenWaf.Infrastructure.Persistence.PolicySetting", b =>
{
b.Property<string>("Key")
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Key");
b.ToTable("policy_settings", (string)null);
});
#pragma warning restore 612, 618
}
}
}