﻿// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.Internal;
using Pongo.BusinessLogic;
using System;

namespace Pongo.BusinessLogic.Migrations
{
    [DbContext(typeof(PongoContext))]
    [Migration("20171105012855_Migration13")]
    partial class Migration13
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "2.0.0-rtm-26452")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("Pongo.BusinessLogic.Cell", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<int?>("ColumnId");

                    b.Property<DateTime>("Created");

                    b.Property<DateTime>("Modified");

                    b.Property<string>("Value")
                        .IsRequired()
                        .HasMaxLength(8000);

                    b.HasKey("Id");

                    b.HasIndex("ColumnId");

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

            modelBuilder.Entity("Pongo.BusinessLogic.Column", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<DateTime>("Created");

                    b.Property<DateTime>("Modified");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(50);

                    b.Property<bool>("Required");

                    b.Property<int?>("TableId");

                    b.Property<int>("Type");

                    b.HasKey("Id");

                    b.HasIndex("TableId");

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

            modelBuilder.Entity("Pongo.BusinessLogic.Table", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<DateTime>("Created");

                    b.Property<DateTime>("Modified");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(50);

                    b.Property<int?>("UserId");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

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

            modelBuilder.Entity("Pongo.BusinessLogic.User", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<DateTime>("Created");

                    b.Property<string>("Email")
                        .IsRequired()
                        .HasMaxLength(100);

                    b.Property<string>("FirstName")
                        .IsRequired()
                        .HasMaxLength(50);

                    b.Property<string>("LastName")
                        .IsRequired()
                        .HasMaxLength(50);

                    b.Property<DateTime>("Modified");

                    b.Property<string>("Password")
                        .IsRequired()
                        .HasMaxLength(50);

                    b.Property<string>("UserName")
                        .IsRequired()
                        .HasMaxLength(50);

                    b.HasKey("Id");

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

            modelBuilder.Entity("Pongo.BusinessLogic.Cell", b =>
                {
                    b.HasOne("Pongo.BusinessLogic.Column")
                        .WithMany("Cells")
                        .HasForeignKey("ColumnId");
                });

            modelBuilder.Entity("Pongo.BusinessLogic.Column", b =>
                {
                    b.HasOne("Pongo.BusinessLogic.Table")
                        .WithMany("Columns")
                        .HasForeignKey("TableId");
                });

            modelBuilder.Entity("Pongo.BusinessLogic.Table", b =>
                {
                    b.HasOne("Pongo.BusinessLogic.User")
                        .WithMany("Tables")
                        .HasForeignKey("UserId");
                });
#pragma warning restore 612, 618
        }
    }
}
