//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using PersonSport.Models;
namespace PersonSport.Migrations
{
[DbContext(typeof(IdrottContext))]
[Migration("20211013071744_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "5.0.10");
modelBuilder.Entity("PersonSport.Models.Admin", b =>
{
b.Property("AdminId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("Password")
.IsRequired()
.HasMaxLength(80)
.HasColumnType("TEXT");
b.Property("Username")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("TEXT");
b.HasKey("AdminId");
b.ToTable("Administratorer");
});
modelBuilder.Entity("PersonSport.Models.Person", b =>
{
b.Property("PersonId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("Alder")
.HasColumnType("INTEGER");
b.Property("Epost")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("PersonNamn")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("StartDatum")
.HasColumnType("TEXT");
b.Property("Visningsbild")
.HasMaxLength(80)
.HasColumnType("TEXT");
b.HasKey("PersonId");
b.ToTable("Personer");
});
modelBuilder.Entity("PersonSport.Models.PersonSport", b =>
{
b.Property("PersonId")
.HasColumnType("INTEGER");
b.Property("SportId")
.HasColumnType("INTEGER");
b.Property("StartDatum")
.HasColumnType("TEXT");
b.HasKey("PersonId", "SportId");
b.HasIndex("SportId");
b.ToTable("PersonSport");
});
modelBuilder.Entity("PersonSport.Models.Sport", b =>
{
b.Property("SportId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("Bakgrundsbild")
.IsRequired()
.HasMaxLength(60)
.HasColumnType("TEXT");
b.Property("DetaljText")
.HasMaxLength(2000)
.HasColumnType("TEXT");
b.Property("Ingress")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property("SportNamn")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("Traningstider")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.HasKey("SportId");
b.ToTable("Sporter");
});
modelBuilder.Entity("PersonSport.Models.PersonSport", b =>
{
b.HasOne("PersonSport.Models.Person", "Person")
.WithMany("PersonSporter")
.HasForeignKey("PersonId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("PersonSport.Models.Sport", "Sport")
.WithMany("PersonSporter")
.HasForeignKey("SportId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Person");
b.Navigation("Sport");
});
modelBuilder.Entity("PersonSport.Models.Person", b =>
{
b.Navigation("PersonSporter");
});
modelBuilder.Entity("PersonSport.Models.Sport", b =>
{
b.Navigation("PersonSporter");
});
#pragma warning restore 612, 618
}
}
}