using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Data.SeaHavenIndustries.Migrations { /// public partial class SyncContactsAndModels : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.RenameColumn( name: "Name", table: "Contacts", newName: "Zip"); migrationBuilder.AddColumn( name: "AccountId", table: "Contacts", type: "int", nullable: true); migrationBuilder.AddColumn( name: "Address1", table: "Contacts", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "Address2", table: "Contacts", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "City", table: "Contacts", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "ContactType", table: "Contacts", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "FacebookUrl", table: "Contacts", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "FirstName", table: "Contacts", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "LastName", table: "Contacts", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "LinkedInUrl", table: "Contacts", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "LocationId", table: "Contacts", type: "int", nullable: true); migrationBuilder.AddColumn( name: "MiddleName", table: "Contacts", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "Owner", table: "Contacts", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "State", table: "Contacts", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "Title", table: "Contacts", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "TwitterUrl", table: "Contacts", type: "nvarchar(max)", nullable: true); migrationBuilder.AlterColumn( name: "Name", table: "AspNetUserTokens", type: "nvarchar(450)", nullable: false, oldClrType: typeof(string), oldType: "nvarchar(128)", oldMaxLength: 128); migrationBuilder.AlterColumn( name: "LoginProvider", table: "AspNetUserTokens", type: "nvarchar(450)", nullable: false, oldClrType: typeof(string), oldType: "nvarchar(128)", oldMaxLength: 128); migrationBuilder.AlterColumn( name: "ProviderKey", table: "AspNetUserLogins", type: "nvarchar(450)", nullable: false, oldClrType: typeof(string), oldType: "nvarchar(128)", oldMaxLength: 128); migrationBuilder.AlterColumn( name: "LoginProvider", table: "AspNetUserLogins", type: "nvarchar(450)", nullable: false, oldClrType: typeof(string), oldType: "nvarchar(128)", oldMaxLength: 128); migrationBuilder.CreateTable( name: "Accounts", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), Type = table.Column(type: "nvarchar(max)", nullable: true), Importance = table.Column(type: "int", nullable: true), TerritoryId = table.Column(type: "int", nullable: true), OwnerEmployeeId = table.Column(type: "int", nullable: true), PrivacySetting = table.Column(type: "nvarchar(max)", nullable: true), About = table.Column(type: "nvarchar(max)", nullable: true), Tags = table.Column(type: "nvarchar(max)", nullable: true), Phone = table.Column(type: "nvarchar(max)", nullable: true), Email = table.Column(type: "nvarchar(max)", nullable: true), IndustryId = table.Column(type: "int", nullable: true), TimeZone = table.Column(type: "nvarchar(max)", nullable: true), Website = table.Column(type: "nvarchar(max)", nullable: true), CurrencyCode = table.Column(type: "nvarchar(max)", nullable: true), ServiceInstructions = table.Column(type: "nvarchar(max)", nullable: true), FacebookUrl = table.Column(type: "nvarchar(max)", nullable: true), LinkedInUrl = table.Column(type: "nvarchar(max)", nullable: true), TwitterUrl = table.Column(type: "nvarchar(max)", nullable: true), IsDeleted = table.Column(type: "bit", nullable: true), createdby = table.Column(type: "nvarchar(max)", nullable: true), DeleterUserId = table.Column(type: "nvarchar(max)", nullable: true), DeletionTime = table.Column(type: "datetime2", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierUserId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Accounts", x => x.Id); }); migrationBuilder.CreateTable( name: "ContactDetails", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ContactId = table.Column(type: "int", nullable: false), Gender = table.Column(type: "nvarchar(max)", nullable: true), DateOfBirth = table.Column(type: "datetime2", nullable: true), Territory = table.Column(type: "nvarchar(max)", nullable: true), PrivacySetting = table.Column(type: "nvarchar(max)", nullable: true), About = table.Column(type: "nvarchar(max)", nullable: true), Tags = table.Column(type: "nvarchar(max)", nullable: true), FacebookUrl = table.Column(type: "nvarchar(max)", nullable: true), LinkedInUrl = table.Column(type: "nvarchar(max)", nullable: true), TwitterUrl = table.Column(type: "nvarchar(max)", nullable: true), IsDeleted = table.Column(type: "bit", nullable: true), createdby = table.Column(type: "nvarchar(max)", nullable: true), DeleterUserId = table.Column(type: "nvarchar(max)", nullable: true), DeletionTime = table.Column(type: "datetime2", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierUserId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_ContactDetails", x => x.Id); table.ForeignKey( name: "FK_ContactDetails_Contacts_ContactId", column: x => x.ContactId, principalTable: "Contacts", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "Departments", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), IsDeleted = table.Column(type: "bit", nullable: true), createdby = table.Column(type: "nvarchar(max)", nullable: true), DeleterUserId = table.Column(type: "nvarchar(max)", nullable: true), DeletionTime = table.Column(type: "datetime2", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierUserId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Departments", x => x.Id); }); migrationBuilder.CreateTable( name: "JobTitles", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), IsDeleted = table.Column(type: "bit", nullable: true), createdby = table.Column(type: "nvarchar(max)", nullable: true), DeleterUserId = table.Column(type: "nvarchar(max)", nullable: true), DeletionTime = table.Column(type: "datetime2", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierUserId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_JobTitles", x => x.Id); }); migrationBuilder.CreateTable( name: "Regions", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), IsDeleted = table.Column(type: "bit", nullable: true), createdby = table.Column(type: "nvarchar(max)", nullable: true), DeleterUserId = table.Column(type: "nvarchar(max)", nullable: true), DeletionTime = table.Column(type: "datetime2", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierUserId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Regions", x => x.Id); }); migrationBuilder.CreateTable( name: "Addresses", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), AddressType = table.Column(type: "nvarchar(max)", nullable: true), Address1 = table.Column(type: "nvarchar(max)", nullable: true), Address2 = table.Column(type: "nvarchar(max)", nullable: true), City = table.Column(type: "nvarchar(max)", nullable: true), State = table.Column(type: "nvarchar(max)", nullable: true), Zip = table.Column(type: "nvarchar(max)", nullable: true), Country = table.Column(type: "nvarchar(max)", nullable: true), County = table.Column(type: "nvarchar(max)", nullable: true), AccountId = table.Column(type: "int", nullable: true), ContactId = table.Column(type: "int", nullable: true), IsDeleted = table.Column(type: "bit", nullable: true), createdby = table.Column(type: "nvarchar(max)", nullable: true), DeleterUserId = table.Column(type: "nvarchar(max)", nullable: true), DeletionTime = table.Column(type: "datetime2", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierUserId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Addresses", x => x.Id); table.ForeignKey( name: "FK_Addresses_Accounts_AccountId", column: x => x.AccountId, principalTable: "Accounts", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_Addresses_Contacts_ContactId", column: x => x.ContactId, principalTable: "Contacts", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "Assets", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), AssetCode = table.Column(type: "nvarchar(max)", nullable: false), Name = table.Column(type: "nvarchar(max)", nullable: false), Description = table.Column(type: "nvarchar(max)", nullable: true), AccountId = table.Column(type: "int", nullable: true), LocationId = table.Column(type: "int", nullable: true), IsActive = table.Column(type: "bit", nullable: false), IsDeleted = table.Column(type: "bit", nullable: true), createdby = table.Column(type: "nvarchar(max)", nullable: true), DeleterUserId = table.Column(type: "nvarchar(max)", nullable: true), DeletionTime = table.Column(type: "datetime2", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierUserId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Assets", x => x.Id); table.ForeignKey( name: "FK_Assets_Accounts_AccountId", column: x => x.AccountId, principalTable: "Accounts", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_Assets_Locations_LocationId", column: x => x.LocationId, principalTable: "Locations", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "Employees", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), FirstName = table.Column(type: "nvarchar(max)", nullable: false), MiddleName = table.Column(type: "nvarchar(max)", nullable: true), LastName = table.Column(type: "nvarchar(max)", nullable: false), DepartmentId = table.Column(type: "int", nullable: true), TimeZone = table.Column(type: "nvarchar(max)", nullable: true), Gender = table.Column(type: "int", nullable: true), DateOfBirth = table.Column(type: "datetime2", nullable: true), JobTitleId = table.Column(type: "int", nullable: true), EmployeeNumber = table.Column(type: "nvarchar(max)", nullable: true), HireDate = table.Column(type: "datetime2", nullable: true), RegionId = table.Column(type: "int", nullable: true), CanChangeProviderNumber = table.Column(type: "bit", nullable: true), About = table.Column(type: "nvarchar(max)", nullable: true), PermissionGroupId = table.Column(type: "int", nullable: true), UserName = table.Column(type: "nvarchar(max)", nullable: true), ConfirmUserName = table.Column(type: "nvarchar(max)", nullable: true), SMSAddress = table.Column(type: "nvarchar(max)", nullable: true), Website = table.Column(type: "nvarchar(max)", nullable: true), FacebookUrl = table.Column(type: "nvarchar(max)", nullable: true), LinkedInUrl = table.Column(type: "nvarchar(max)", nullable: true), TwitterUrl = table.Column(type: "nvarchar(max)", nullable: true), Status = table.Column(type: "nvarchar(max)", nullable: true), LastLogin = table.Column(type: "datetime2", nullable: true), IsDeleted = table.Column(type: "bit", nullable: true), CreatedBy = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierUserId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Employees", x => x.Id); table.ForeignKey( name: "FK_Employees_Departments_DepartmentId", column: x => x.DepartmentId, principalTable: "Departments", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_Employees_JobTitles_JobTitleId", column: x => x.JobTitleId, principalTable: "JobTitles", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_Employees_Regions_RegionId", column: x => x.RegionId, principalTable: "Regions", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "PMSchedules", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: false), Frequency = table.Column(type: "nvarchar(max)", nullable: false), StartDate = table.Column(type: "datetime2", nullable: false), IsActive = table.Column(type: "bit", nullable: false), AssetId = table.Column(type: "int", nullable: true), LocationId = table.Column(type: "int", nullable: true), IsDeleted = table.Column(type: "bit", nullable: true), createdby = table.Column(type: "nvarchar(max)", nullable: true), DeleterUserId = table.Column(type: "nvarchar(max)", nullable: true), DeletionTime = table.Column(type: "datetime2", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierUserId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_PMSchedules", x => x.Id); table.ForeignKey( name: "FK_PMSchedules_Assets_AssetId", column: x => x.AssetId, principalTable: "Assets", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_PMSchedules_Locations_LocationId", column: x => x.LocationId, principalTable: "Locations", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "EmployeeAddresses", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), EmployeeId = table.Column(type: "int", nullable: false), Street = table.Column(type: "nvarchar(max)", nullable: true), StreetLineTwo = table.Column(type: "nvarchar(max)", nullable: true), City = table.Column(type: "nvarchar(max)", nullable: true), Zip = table.Column(type: "nvarchar(max)", nullable: true), CountryCode = table.Column(type: "nvarchar(max)", nullable: true), StateCode = table.Column(type: "nvarchar(max)", nullable: true), CountyId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_EmployeeAddresses", x => x.Id); table.ForeignKey( name: "FK_EmployeeAddresses_Employees_EmployeeId", column: x => x.EmployeeId, principalTable: "Employees", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "EmployeeEmails", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), EmployeeId = table.Column(type: "int", nullable: false), EmailTypeId = table.Column(type: "int", nullable: true), Address = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), IsPrimary = table.Column(type: "bit", nullable: true), IsDeleted = table.Column(type: "bit", nullable: true), createdby = table.Column(type: "nvarchar(max)", nullable: true), DeleterUserId = table.Column(type: "nvarchar(max)", nullable: true), DeletionTime = table.Column(type: "datetime2", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierUserId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_EmployeeEmails", x => x.Id); table.ForeignKey( name: "FK_EmployeeEmails_Employees_EmployeeId", column: x => x.EmployeeId, principalTable: "Employees", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "EmployeePhones", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), EmployeeId = table.Column(type: "int", nullable: false), PhoneTypeId = table.Column(type: "int", nullable: true), Number = table.Column(type: "nvarchar(max)", nullable: true), Extension = table.Column(type: "nvarchar(max)", nullable: true), IsPrimary = table.Column(type: "bit", nullable: true) }, constraints: table => { table.PrimaryKey("PK_EmployeePhones", x => x.Id); table.ForeignKey( name: "FK_EmployeePhones_Employees_EmployeeId", column: x => x.EmployeeId, principalTable: "Employees", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "FollowUps", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Reason = table.Column(type: "nvarchar(max)", nullable: false), ScheduleDate = table.Column(type: "datetime2", nullable: false), ScheduleStartTime = table.Column(type: "time", nullable: false), Status = table.Column(type: "nvarchar(max)", nullable: false), EmployeeId = table.Column(type: "int", nullable: true), WorkOrderId = table.Column(type: "int", nullable: true), AccountId = table.Column(type: "int", nullable: true), LocationId = table.Column(type: "int", nullable: true), IsDeleted = table.Column(type: "bit", nullable: true), createdby = table.Column(type: "nvarchar(max)", nullable: true), DeleterUserId = table.Column(type: "nvarchar(max)", nullable: true), DeletionTime = table.Column(type: "datetime2", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierUserId = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_FollowUps", x => x.Id); table.ForeignKey( name: "FK_FollowUps_Accounts_AccountId", column: x => x.AccountId, principalTable: "Accounts", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_FollowUps_Employees_EmployeeId", column: x => x.EmployeeId, principalTable: "Employees", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_FollowUps_Locations_LocationId", column: x => x.LocationId, principalTable: "Locations", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_FollowUps_workOrders_WorkOrderId", column: x => x.WorkOrderId, principalTable: "workOrders", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_Contacts_AccountId", table: "Contacts", column: "AccountId"); migrationBuilder.CreateIndex( name: "IX_Contacts_LocationId", table: "Contacts", column: "LocationId"); migrationBuilder.CreateIndex( name: "IX_Addresses_AccountId", table: "Addresses", column: "AccountId"); migrationBuilder.CreateIndex( name: "IX_Addresses_ContactId", table: "Addresses", column: "ContactId"); migrationBuilder.CreateIndex( name: "IX_Assets_AccountId", table: "Assets", column: "AccountId"); migrationBuilder.CreateIndex( name: "IX_Assets_LocationId", table: "Assets", column: "LocationId"); migrationBuilder.CreateIndex( name: "IX_ContactDetails_ContactId", table: "ContactDetails", column: "ContactId"); migrationBuilder.CreateIndex( name: "IX_EmployeeAddresses_EmployeeId", table: "EmployeeAddresses", column: "EmployeeId", unique: true); migrationBuilder.CreateIndex( name: "IX_EmployeeEmails_EmployeeId", table: "EmployeeEmails", column: "EmployeeId"); migrationBuilder.CreateIndex( name: "IX_EmployeePhones_EmployeeId", table: "EmployeePhones", column: "EmployeeId"); migrationBuilder.CreateIndex( name: "IX_Employees_DepartmentId", table: "Employees", column: "DepartmentId"); migrationBuilder.CreateIndex( name: "IX_Employees_JobTitleId", table: "Employees", column: "JobTitleId"); migrationBuilder.CreateIndex( name: "IX_Employees_RegionId", table: "Employees", column: "RegionId"); migrationBuilder.CreateIndex( name: "IX_FollowUps_AccountId", table: "FollowUps", column: "AccountId"); migrationBuilder.CreateIndex( name: "IX_FollowUps_EmployeeId", table: "FollowUps", column: "EmployeeId"); migrationBuilder.CreateIndex( name: "IX_FollowUps_LocationId", table: "FollowUps", column: "LocationId"); migrationBuilder.CreateIndex( name: "IX_FollowUps_WorkOrderId", table: "FollowUps", column: "WorkOrderId"); migrationBuilder.CreateIndex( name: "IX_PMSchedules_AssetId", table: "PMSchedules", column: "AssetId"); migrationBuilder.CreateIndex( name: "IX_PMSchedules_LocationId", table: "PMSchedules", column: "LocationId"); migrationBuilder.AddForeignKey( name: "FK_Contacts_Accounts_AccountId", table: "Contacts", column: "AccountId", principalTable: "Accounts", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_Contacts_Locations_LocationId", table: "Contacts", column: "LocationId", principalTable: "Locations", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Contacts_Accounts_AccountId", table: "Contacts"); migrationBuilder.DropForeignKey( name: "FK_Contacts_Locations_LocationId", table: "Contacts"); migrationBuilder.DropTable( name: "Addresses"); migrationBuilder.DropTable( name: "ContactDetails"); migrationBuilder.DropTable( name: "EmployeeAddresses"); migrationBuilder.DropTable( name: "EmployeeEmails"); migrationBuilder.DropTable( name: "EmployeePhones"); migrationBuilder.DropTable( name: "FollowUps"); migrationBuilder.DropTable( name: "PMSchedules"); migrationBuilder.DropTable( name: "Employees"); migrationBuilder.DropTable( name: "Assets"); migrationBuilder.DropTable( name: "Departments"); migrationBuilder.DropTable( name: "JobTitles"); migrationBuilder.DropTable( name: "Regions"); migrationBuilder.DropTable( name: "Accounts"); migrationBuilder.DropIndex( name: "IX_Contacts_AccountId", table: "Contacts"); migrationBuilder.DropIndex( name: "IX_Contacts_LocationId", table: "Contacts"); migrationBuilder.DropColumn( name: "AccountId", table: "Contacts"); migrationBuilder.DropColumn( name: "Address1", table: "Contacts"); migrationBuilder.DropColumn( name: "Address2", table: "Contacts"); migrationBuilder.DropColumn( name: "City", table: "Contacts"); migrationBuilder.DropColumn( name: "ContactType", table: "Contacts"); migrationBuilder.DropColumn( name: "FacebookUrl", table: "Contacts"); migrationBuilder.DropColumn( name: "FirstName", table: "Contacts"); migrationBuilder.DropColumn( name: "LastName", table: "Contacts"); migrationBuilder.DropColumn( name: "LinkedInUrl", table: "Contacts"); migrationBuilder.DropColumn( name: "LocationId", table: "Contacts"); migrationBuilder.DropColumn( name: "MiddleName", table: "Contacts"); migrationBuilder.DropColumn( name: "Owner", table: "Contacts"); migrationBuilder.DropColumn( name: "State", table: "Contacts"); migrationBuilder.DropColumn( name: "Title", table: "Contacts"); migrationBuilder.DropColumn( name: "TwitterUrl", table: "Contacts"); migrationBuilder.RenameColumn( name: "Zip", table: "Contacts", newName: "Name"); migrationBuilder.AlterColumn( name: "Name", table: "AspNetUserTokens", type: "nvarchar(128)", maxLength: 128, nullable: false, oldClrType: typeof(string), oldType: "nvarchar(450)"); migrationBuilder.AlterColumn( name: "LoginProvider", table: "AspNetUserTokens", type: "nvarchar(128)", maxLength: 128, nullable: false, oldClrType: typeof(string), oldType: "nvarchar(450)"); migrationBuilder.AlterColumn( name: "ProviderKey", table: "AspNetUserLogins", type: "nvarchar(128)", maxLength: 128, nullable: false, oldClrType: typeof(string), oldType: "nvarchar(450)"); migrationBuilder.AlterColumn( name: "LoginProvider", table: "AspNetUserLogins", type: "nvarchar(128)", maxLength: 128, nullable: false, oldClrType: typeof(string), oldType: "nvarchar(450)"); } } }