//
using System;
using System.Collections.Generic;
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("20241011050136_v0.4-rc1")]
partial class v04rc1
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.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.Handlers.DiscordAlertChannel", b =>
{
b.Property("DiscordAlertChannelId")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("DiscordAlertChannelId"));
b.Property("ChannelId")
.HasColumnType("numeric(20,0)");
b.Property("GuildId")
.HasColumnType("numeric(20,0)");
b.Property("RequireMention")
.HasColumnType("boolean");
b.HasKey("DiscordAlertChannelId");
b.HasIndex("GuildId")
.IsUnique();
b.ToTable("DiscordAlertChannels");
});
modelBuilder.Entity("PagerParser.Handlers.DiscordAlertSubscription", b =>
{
b.Property("DiscordAlertSubscriptionId")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("DiscordAlertSubscriptionId"));
b.Property("GuildId")
.HasColumnType("numeric(20,0)");
b.Property("PageDestination")
.IsRequired()
.HasColumnType("text");
b.Property("PrincipalId")
.HasColumnType("numeric(20,0)");
b.Property("PrincipalType")
.HasColumnType("integer");
b.HasKey("DiscordAlertSubscriptionId");
b.HasIndex("GuildId");
b.ToTable("DiscordAlertSubscriptions");
});
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>("PagedServices")
.IsRequired()
.HasColumnType("text[]");
b.Property("PagerMessage")
.HasColumnType("integer");
b.HasKey("ParsedPagerMessageId");
b.HasIndex("FirecomJobNo");
b.HasIndex("GpsPositionId");
b.HasIndex("PageDestination");
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
}
}
}