//
using System;
using MessengerApi.Db.Sql;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace MessengerApi.Db.Sql.Migrations
{
[DbContext(typeof(MessengerSqlDbContext))]
partial class MessengerSqlDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.6")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("MessengerApi.Db.Entities.Message", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property("CreatedUtc")
.HasColumnType("datetime2");
b.Property("FromId")
.HasColumnType("uniqueidentifier");
b.Property("IsAcknowledged")
.HasColumnType("bit");
b.Property("IsDelivered")
.HasColumnType("bit");
b.Property("Payload")
.HasColumnType("nvarchar(max)");
b.Property("PayloadType")
.HasColumnType("nvarchar(max)");
b.Property("TimeToLiveInSeconds")
.HasColumnType("int");
b.Property("ToId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("ToId", "IsDelivered");
SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("ToId", "IsDelivered"), false);
b.ToTable("Messages");
});
modelBuilder.Entity("MessengerApi.Db.Entities.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property("ApiKey")
.HasColumnType("uniqueidentifier");
b.Property("IsEnabled")
.HasColumnType("bit");
b.Property("Name")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("MessengerApi.Db.Entities.UserRoute", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property("FromId")
.HasColumnType("uniqueidentifier");
b.Property("ToId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("FromId");
b.HasIndex("ToId");
b.ToTable("UserRoutes");
});
modelBuilder.Entity("MessengerApi.Db.Entities.UserRoute", b =>
{
b.HasOne("MessengerApi.Db.Entities.User", "From")
.WithMany()
.HasForeignKey("FromId");
b.HasOne("MessengerApi.Db.Entities.User", "To")
.WithMany()
.HasForeignKey("ToId");
b.Navigation("From");
b.Navigation("To");
});
#pragma warning restore 612, 618
}
}
}