//
using System;
using System.Net;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using NetTopologySuite.Geometries;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using WhatApi;
#nullable disable
namespace WhatApi.Migrations
{
[DbContext(typeof(Database))]
partial class DatabaseModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.9")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "postgis");
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("WhatApi.Tables.Content", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("BlobId")
.HasColumnType("uuid");
b.Property("Created")
.HasColumnType("timestamp with time zone");
b.Property("Ip")
.IsRequired()
.HasColumnType("inet");
b.Property("Mime")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Content");
});
modelBuilder.Entity("WhatApi.Tables.Place", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("ContentId")
.HasColumnType("uuid");
b.Property("Location")
.IsRequired()
.HasColumnType("geometry(point,4326)");
b.HasKey("Id");
b.HasIndex("ContentId");
b.HasIndex("Location");
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("Location"), "gist");
b.ToTable("Place", (string)null);
});
modelBuilder.Entity("WhatApi.Tables.Place", b =>
{
b.HasOne("WhatApi.Tables.Content", "Content")
.WithMany()
.HasForeignKey("ContentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Content");
});
#pragma warning restore 612, 618
}
}
}