//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using PagerParser;
#nullable disable
namespace PagerParser.Migrations
{
[DbContext(typeof(PagerContext))]
[Migration("20230806022522_MapType")]
partial class MapType
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("PagerParser.GpsPosition", b =>
{
b.Property("GpsPositionId")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("GpsPositionId"));
b.Property("Latitude")
.HasColumnType("double precision");
b.Property("Longitude")
.HasColumnType("double precision");
b.HasKey("GpsPositionId");
b.ToTable("GpsPositions");
});
modelBuilder.Entity("PagerParser.PagerMessage", b =>
{
b.Property("PagerMessageId")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("PagerMessageId"));
b.Property("Message")
.IsRequired()
.HasColumnType("text");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone");
b.HasKey("PagerMessageId");
b.HasIndex("Message");
b.ToTable("PagerMessages");
});
modelBuilder.Entity("PagerParser.ParsedPagerMessage", b =>
{
b.Property("ParsedPagerMessageId")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ParsedPagerMessageId"));
b.Property("AlertLevel")
.HasColumnType("integer");
b.Property("AssignmentArea")
.IsRequired()
.HasColumnType("text");
b.Property("AttendingServices")
.HasColumnType("integer");
b.Property("Description")
.IsRequired()
.HasColumnType("text");
b.Property("FireGroundChannel")
.HasColumnType("integer");
b.Property("FirecomJobNo")
.HasColumnType("integer");
b.Property("GpsPositionId")
.HasColumnType("integer");
b.Property("GridReference")
.HasColumnType("integer");
b.Property("JobType")
.IsRequired()
.HasColumnType("text");
b.Property("MapGrid")
.HasColumnType("text");
b.Property("MapNo")
.HasColumnType("integer");
b.Property("MapType")
.HasColumnType("integer");
b.Property("Note")
.HasColumnType("text");
b.Property("PageDestination")
.IsRequired()
.HasColumnType("text");
b.Property("PagerMessage")
.HasColumnType("integer");
b.HasKey("ParsedPagerMessageId");
b.HasIndex("FirecomJobNo");
b.HasIndex("GpsPositionId");
b.HasIndex("PagerMessage")
.IsUnique();
b.ToTable("ParsedPagerMessages");
});
modelBuilder.Entity("PagerParser.ParsedPagerMessage", b =>
{
b.HasOne("PagerParser.GpsPosition", "GpsPosition")
.WithMany()
.HasForeignKey("GpsPositionId");
b.HasOne("PagerParser.PagerMessage", "OriginalMessage")
.WithOne("ParsedMessage")
.HasForeignKey("PagerParser.ParsedPagerMessage", "PagerMessage")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("GpsPosition");
b.Navigation("OriginalMessage");
});
modelBuilder.Entity("PagerParser.PagerMessage", b =>
{
b.Navigation("ParsedMessage");
});
#pragma warning restore 612, 618
}
}
}