//
using System;
using System.Net;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using QuestShare.Server.Models;
#nullable disable
namespace QuestShare.Server.Migrations
{
[DbContext(typeof(QuestShareContext))]
[Migration("20250217022911_InitialCreate")]
partial class InitialCreate
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("QuestShare.Server.Models.Ban", b =>
{
b.Property("BanId")
.HasColumnType("text");
b.Property("BanCharacterId")
.HasColumnType("numeric(20,0)");
b.Property("BanDate")
.HasColumnType("timestamp with time zone");
b.Property("BanExpiry")
.HasColumnType("timestamp with time zone");
b.Property("BanIp")
.IsRequired()
.HasColumnType("inet");
b.Property("BanIssuer")
.IsRequired()
.HasColumnType("text");
b.Property("BanReason")
.IsRequired()
.HasColumnType("text");
b.HasKey("BanId");
b.ToTable("Bans", (string)null);
});
modelBuilder.Entity("QuestShare.Server.Models.Client", b =>
{
b.Property("ClientId")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("CharacterId")
.HasColumnType("numeric(20,0)");
b.Property("ConnectedShareCode")
.IsRequired()
.HasColumnType("text");
b.Property("ConnectionId")
.IsRequired()
.HasColumnType("text");
b.Property("Created")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("current_timestamp");
b.Property("LastUpdated")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("current_timestamp");
b.Property("Token")
.IsRequired()
.HasColumnType("text");
b.HasKey("ClientId");
b.ToTable("Clients", (string)null);
});
modelBuilder.Entity("QuestShare.Server.Models.Quest", b =>
{
b.Property("QuestObjId")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("QuestObjId"));
b.Property("CurrentStep")
.HasColumnType("smallint");
b.Property("IsActive")
.HasColumnType("boolean");
b.Property("QuestId")
.HasColumnType("bigint");
b.Property("ShareId")
.HasColumnType("uuid");
b.Property("ShareId1")
.HasColumnType("uuid");
b.HasKey("QuestObjId");
b.HasIndex("ShareId");
b.HasIndex("ShareId1");
b.ToTable("Quests", (string)null);
});
modelBuilder.Entity("QuestShare.Server.Models.Share", b =>
{
b.Property("ShareId")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("BroadcastParty")
.HasColumnType("boolean");
b.Property("Created")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("current_timestamp");
b.Property("LastUpdated")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("current_timestamp");
b.Property("ShareCode")
.IsRequired()
.HasColumnType("text");
b.Property("ShareHostClientId")
.HasColumnType("uuid");
b.HasKey("ShareId");
b.HasIndex("ShareHostClientId");
b.ToTable("QuestShares", (string)null);
});
modelBuilder.Entity("QuestShare.Server.Models.Quest", b =>
{
b.HasOne("QuestShare.Server.Models.Share", null)
.WithMany("Quests")
.HasForeignKey("ShareId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("QuestShare.Server.Models.Share", "Share")
.WithMany()
.HasForeignKey("ShareId1")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Share");
});
modelBuilder.Entity("QuestShare.Server.Models.Share", b =>
{
b.HasOne("QuestShare.Server.Models.Client", "ShareHost")
.WithMany()
.HasForeignKey("ShareHostClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ShareHost");
});
modelBuilder.Entity("QuestShare.Server.Models.Share", b =>
{
b.Navigation("Quests");
});
#pragma warning restore 612, 618
}
}
}