//
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SessionCompanion.Database;
namespace SessionCompanion.Database.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.UseIdentityColumns()
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "5.0.0");
modelBuilder.Entity("SessionCompanion.Database.Tables.Alignment", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.UseIdentityColumn();
b.HasKey("Id");
b.ToTable("Alignments");
});
modelBuilder.Entity("SessionCompanion.Database.Tables.Background", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.UseIdentityColumn();
b.HasKey("Id");
b.ToTable("Backgrounds");
});
modelBuilder.Entity("SessionCompanion.Database.Tables.Biography", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.UseIdentityColumn();
b.Property("AlignmentId")
.HasColumnType("int");
b.Property("BackgroundId")
.HasColumnType("int");
b.Property("CharacterId")
.HasColumnType("int");
b.Property("ClassId")
.HasColumnType("int");
b.Property("Name")
.HasColumnType("nvarchar(max)");
b.Property("RaceId")
.HasColumnType("int");
b.Property("Sex")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("AlignmentId");
b.HasIndex("BackgroundId");
b.HasIndex("CharacterId")
.IsUnique();
b.HasIndex("ClassId");
b.HasIndex("RaceId");
b.ToTable("Biographies");
});
modelBuilder.Entity("SessionCompanion.Database.Tables.Character", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.UseIdentityColumn();
b.Property("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Characters");
});
modelBuilder.Entity("SessionCompanion.Database.Tables.Class", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.UseIdentityColumn();
b.Property("Name")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Classes");
});
modelBuilder.Entity("SessionCompanion.Database.Tables.Race", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.UseIdentityColumn();
b.Property("Name")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Races");
});
modelBuilder.Entity("SessionCompanion.Database.Tables.Statistics", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.UseIdentityColumn();
b.Property("ArmorClass")
.HasColumnType("int");
b.Property("CharacterId")
.HasColumnType("int");
b.Property("CurrentHealthPoints")
.HasColumnType("int");
b.Property("ExperiencePoints")
.HasColumnType("int");
b.Property("HealthPoints")
.HasColumnType("int");
b.Property("Initiative")
.HasColumnType("int");
b.Property("Level")
.HasColumnType("int");
b.Property("Proficiency")
.HasColumnType("int");
b.Property("Speed")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CharacterId")
.IsUnique();
b.ToTable("Statistics");
});
modelBuilder.Entity("SessionCompanion.Database.Tables.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.UseIdentityColumn();
b.Property("Nickname")
.HasColumnType("nvarchar(max)");
b.Property("Password")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users");
b.HasData(
new
{
Id = 1,
Nickname = "Morwiec",
Password = "123"
},
new
{
Id = 2,
Nickname = "Cichoklepiec",
Password = "123"
},
new
{
Id = 3,
Nickname = "Ruletka",
Password = "123"
});
});
modelBuilder.Entity("SessionCompanion.Database.Tables.Biography", b =>
{
b.HasOne("SessionCompanion.Database.Tables.Alignment", "Alignment")
.WithMany("Biography")
.HasForeignKey("AlignmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("SessionCompanion.Database.Tables.Background", "Background")
.WithMany("Biography")
.HasForeignKey("BackgroundId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("SessionCompanion.Database.Tables.Character", "Character")
.WithOne("Biography")
.HasForeignKey("SessionCompanion.Database.Tables.Biography", "CharacterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("SessionCompanion.Database.Tables.Class", "Class")
.WithMany("Biography")
.HasForeignKey("ClassId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("SessionCompanion.Database.Tables.Race", "Race")
.WithMany("Biography")
.HasForeignKey("RaceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Alignment");
b.Navigation("Background");
b.Navigation("Character");
b.Navigation("Class");
b.Navigation("Race");
});
modelBuilder.Entity("SessionCompanion.Database.Tables.Character", b =>
{
b.HasOne("SessionCompanion.Database.Tables.User", "User")
.WithMany("Character")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("SessionCompanion.Database.Tables.Statistics", b =>
{
b.HasOne("SessionCompanion.Database.Tables.Character", "Character")
.WithOne("Statistics")
.HasForeignKey("SessionCompanion.Database.Tables.Statistics", "CharacterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Character");
});
modelBuilder.Entity("SessionCompanion.Database.Tables.Alignment", b =>
{
b.Navigation("Biography");
});
modelBuilder.Entity("SessionCompanion.Database.Tables.Background", b =>
{
b.Navigation("Biography");
});
modelBuilder.Entity("SessionCompanion.Database.Tables.Character", b =>
{
b.Navigation("Biography");
b.Navigation("Statistics");
});
modelBuilder.Entity("SessionCompanion.Database.Tables.Class", b =>
{
b.Navigation("Biography");
});
modelBuilder.Entity("SessionCompanion.Database.Tables.Race", b =>
{
b.Navigation("Biography");
});
modelBuilder.Entity("SessionCompanion.Database.Tables.User", b =>
{
b.Navigation("Character");
});
#pragma warning restore 612, 618
}
}
}