namespace RentahuntApp.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class addinglistingmodel : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.ListingModels",
                c => new
                    {
                        ListingId = c.Int(nullable: false, identity: true),
                        UserId = c.String(nullable: false, maxLength: 128),
                        DateCreated = c.DateTime(nullable: false),
                        Active = c.Boolean(nullable: false),
                        ExpirationDate = c.DateTime(nullable: false),
                        Title = c.String(nullable: false),
                        Location = c.String(nullable: false),
                        Lat = c.Double(nullable: false),
                        Lng = c.Double(nullable: false),
                        County = c.String(nullable: false),
                        Acreage = c.Double(nullable: false),
                        Description = c.String(nullable: false),
                        ProhibitedActivities = c.String(),
                        HostPhone = c.String(nullable: false),
                        HostEmail = c.String(nullable: false),
                        HostPayPalEmail = c.String(nullable: false),
                        BoundaryInfo = c.String(nullable: false),
                        AccessInfo = c.String(nullable: false),
                        MeetupReqired = c.Boolean(nullable: false),
                    })
                .PrimaryKey(t => t.ListingId)
                .ForeignKey("dbo.AspNetUsers", t => t.UserId, cascadeDelete: true)
                .Index(t => t.UserId);
            
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.ListingModels", "UserId", "dbo.AspNetUsers");
            DropIndex("dbo.ListingModels", new[] { "UserId" });
            DropTable("dbo.ListingModels");
        }
    }
}
