// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Shride.Models;

namespace Shride.Migrations
{
    [DbContext(typeof(RideDbContext))]
    partial class RideDbContextModelSnapshot : 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("PersonRide", b =>
                {
                    b.Property<int>("PersonsPersonId")
                        .HasColumnType("int");

                    b.Property<int>("RidesRideId")
                        .HasColumnType("int");

                    b.HasKey("PersonsPersonId", "RidesRideId");

                    b.HasIndex("RidesRideId");

                    b.ToTable("PersonRide");
                });

            modelBuilder.Entity("Shride.Models.Account", b =>
                {
                    b.Property<int>("AccountId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .UseIdentityColumn();

                    b.Property<string>("Email")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Phone")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("Private")
                        .HasColumnType("bit");

                    b.HasKey("AccountId");

                    b.ToTable("Accounts");
                });

            modelBuilder.Entity("Shride.Models.Event", b =>
                {
                    b.Property<int>("EventId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .UseIdentityColumn();

                    b.Property<int>("AccountId")
                        .HasColumnType("int");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Location")
                        .HasColumnType("nvarchar(max)");

                    b.Property<double>("LocationLat")
                        .HasColumnType("float");

                    b.Property<double>("LocationLng")
                        .HasColumnType("float");

                    b.Property<string>("Name")
                        .HasColumnType("nvarchar(max)");

                    b.Property<bool>("Private")
                        .HasColumnType("bit");

                    b.Property<DateTime>("Time")
                        .HasColumnType("datetime2");

                    b.HasKey("EventId");

                    b.HasIndex("AccountId");

                    b.ToTable("Events");
                });

            modelBuilder.Entity("Shride.Models.Person", b =>
                {
                    b.Property<int>("PersonId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .UseIdentityColumn();

                    b.Property<int>("AccountId")
                        .HasColumnType("int");

                    b.Property<bool>("Allergic")
                        .HasColumnType("bit");

                    b.Property<DateTime>("BirthDate")
                        .HasColumnType("datetime2");

                    b.Property<string>("FirstName")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("Gender")
                        .HasColumnType("int");

                    b.Property<string>("LastName")
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("PersonId");

                    b.HasIndex("AccountId");

                    b.ToTable("Persons");
                });

            modelBuilder.Entity("Shride.Models.Review", b =>
                {
                    b.Property<int>("ReviewId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .UseIdentityColumn();

                    b.Property<int>("AccountId")
                        .HasColumnType("int");

                    b.Property<string>("Description")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("Rating")
                        .HasColumnType("int");

                    b.Property<int?>("RideId")
                        .HasColumnType("int");

                    b.HasKey("ReviewId");

                    b.HasIndex("AccountId");

                    b.HasIndex("RideId");

                    b.ToTable("Reviews");
                });

            modelBuilder.Entity("Shride.Models.Ride", b =>
                {
                    b.Property<int>("RideId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .UseIdentityColumn();

                    b.Property<bool>("Cancelled")
                        .HasColumnType("bit");

                    b.Property<DateTime>("Departure")
                        .HasColumnType("datetime2");

                    b.Property<string>("End")
                        .HasColumnType("nvarchar(max)");

                    b.Property<double>("EndLat")
                        .HasColumnType("float");

                    b.Property<double>("EndLng")
                        .HasColumnType("float");

                    b.Property<int?>("EventId")
                        .HasColumnType("int");

                    b.Property<int>("Seats")
                        .HasColumnType("int");

                    b.Property<string>("Start")
                        .HasColumnType("nvarchar(max)");

                    b.Property<double>("StartLat")
                        .HasColumnType("float");

                    b.Property<double>("StartLng")
                        .HasColumnType("float");

                    b.Property<int?>("VehicleId")
                        .HasColumnType("int");

                    b.HasKey("RideId");

                    b.HasIndex("EventId");

                    b.HasIndex("VehicleId");

                    b.ToTable("Rides");
                });

            modelBuilder.Entity("Shride.Models.Transaction", b =>
                {
                    b.Property<int>("TransactionId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .UseIdentityColumn();

                    b.Property<int>("AccountId")
                        .HasColumnType("int");

                    b.Property<bool>("Paid")
                        .HasColumnType("bit");

                    b.Property<double>("Price")
                        .HasColumnType("float");

                    b.Property<int>("RideId")
                        .HasColumnType("int");

                    b.HasKey("TransactionId");

                    b.HasIndex("AccountId");

                    b.HasIndex("RideId");

                    b.ToTable("Transactions");
                });

            modelBuilder.Entity("Shride.Models.Vehicle", b =>
                {
                    b.Property<int>("VehicleId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int")
                        .UseIdentityColumn();

                    b.Property<int>("AccountId")
                        .HasColumnType("int");

                    b.Property<bool>("AllergyFree")
                        .HasColumnType("bit");

                    b.Property<bool>("Animal")
                        .HasColumnType("bit");

                    b.Property<bool>("Children")
                        .HasColumnType("bit");

                    b.Property<string>("RegNr")
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("Seats")
                        .HasColumnType("int");

                    b.HasKey("VehicleId");

                    b.HasIndex("AccountId");

                    b.ToTable("Vehicles");
                });

            modelBuilder.Entity("PersonRide", b =>
                {
                    b.HasOne("Shride.Models.Person", null)
                        .WithMany()
                        .HasForeignKey("PersonsPersonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Shride.Models.Ride", null)
                        .WithMany()
                        .HasForeignKey("RidesRideId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Shride.Models.Event", b =>
                {
                    b.HasOne("Shride.Models.Account", "Account")
                        .WithMany("Events")
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Account");
                });

            modelBuilder.Entity("Shride.Models.Person", b =>
                {
                    b.HasOne("Shride.Models.Account", "Account")
                        .WithMany("Persons")
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Account");
                });

            modelBuilder.Entity("Shride.Models.Review", b =>
                {
                    b.HasOne("Shride.Models.Account", "Account")
                        .WithMany()
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Shride.Models.Ride", null)
                        .WithMany("Reviews")
                        .HasForeignKey("RideId");

                    b.Navigation("Account");
                });

            modelBuilder.Entity("Shride.Models.Ride", b =>
                {
                    b.HasOne("Shride.Models.Event", null)
                        .WithMany("Rides")
                        .HasForeignKey("EventId");

                    b.HasOne("Shride.Models.Vehicle", "Vehicle")
                        .WithMany("Rides")
                        .HasForeignKey("VehicleId");

                    b.Navigation("Vehicle");
                });

            modelBuilder.Entity("Shride.Models.Transaction", b =>
                {
                    b.HasOne("Shride.Models.Account", "Account")
                        .WithMany()
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Shride.Models.Ride", "Ride")
                        .WithMany("Transactions")
                        .HasForeignKey("RideId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Account");

                    b.Navigation("Ride");
                });

            modelBuilder.Entity("Shride.Models.Vehicle", b =>
                {
                    b.HasOne("Shride.Models.Account", "Account")
                        .WithMany("Vehicles")
                        .HasForeignKey("AccountId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Account");
                });

            modelBuilder.Entity("Shride.Models.Account", b =>
                {
                    b.Navigation("Events");

                    b.Navigation("Persons");

                    b.Navigation("Vehicles");
                });

            modelBuilder.Entity("Shride.Models.Event", b =>
                {
                    b.Navigation("Rides");
                });

            modelBuilder.Entity("Shride.Models.Ride", b =>
                {
                    b.Navigation("Reviews");

                    b.Navigation("Transactions");
                });

            modelBuilder.Entity("Shride.Models.Vehicle", b =>
                {
                    b.Navigation("Rides");
                });
#pragma warning restore 612, 618
        }
    }
}
