using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace OFBButte.Database.Migrations { public partial class Initial : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "EmailVerificationCodes", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Code = table.Column(nullable: true), CreatedDate = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_EmailVerificationCodes", x => x.Id); }); migrationBuilder.CreateTable( name: "MissionarySupportForms", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Name = table.Column(nullable: true), HomePhone = table.Column(nullable: true), CellPhone = table.Column(nullable: true), FieldPhone = table.Column(nullable: true), WifesName = table.Column(nullable: true), Testimony = table.Column(nullable: true), CallToField = table.Column(nullable: true), SendingChurch = table.Column(nullable: true), FieldOfService = table.Column(nullable: true), Plans = table.Column(nullable: true), EvaluationOfNationals = table.Column(nullable: true), TimeInCountry = table.Column(nullable: true), CorrectWrongOfAnotherMissionary = table.Column(nullable: true), FinancialStatementPrevYear = table.Column(nullable: true), CurrentMonthlySupport = table.Column(nullable: true), MonthlySupportNeeded = table.Column(nullable: true), RestAndRelaxation = table.Column(nullable: true), AloneOrTeam = table.Column(nullable: true), ChildrenSchool = table.Column(nullable: false), Dance = table.Column(nullable: false), WorldlyMusic = table.Column(nullable: false), MovieTheaters = table.Column(nullable: false), Alcohol = table.Column(nullable: false), Smoking = table.Column(nullable: false), MaleHair = table.Column(nullable: false), FemaleSlacks = table.Column(nullable: false), FemaleShorts = table.Column(nullable: false), FemaleDressStandard = table.Column(nullable: false), SwimmingClothing = table.Column(nullable: true), Television = table.Column(nullable: true), DailyBible = table.Column(nullable: false), NumberLedToChrist = table.Column(nullable: false), NumberWitnessedTo = table.Column(nullable: false), NumberWeeklyTracts = table.Column(nullable: false), RateOfSuccess = table.Column(nullable: true), Predestination = table.Column(nullable: true), FellowshipAssociation = table.Column(nullable: true), AdmittedWrong = table.Column(nullable: true), Divorced = table.Column(nullable: false), GroundsForRemarry = table.Column(nullable: false), MarryADivorcee = table.Column(nullable: false), MasonicLodge = table.Column(nullable: false), BibleVersionsUsed = table.Column(nullable: true), BibleVersionOpinion = table.Column(nullable: true), ContemporaryMusic = table.Column(nullable: false), Charasmaticism = table.Column(nullable: true), Tongues = table.Column(nullable: false), RepentanceNecessary = table.Column(nullable: false), RepentanceDefinition = table.Column(nullable: true), Fundamentalist = table.Column(nullable: false), BillsOnTime = table.Column(nullable: false), LateBills = table.Column(nullable: true), LateBillActionTaken = table.Column(nullable: true), PotentialHarvest = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_MissionarySupportForms", x => x.Id); }); migrationBuilder.CreateTable( name: "PasswordResetCodes", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Code = table.Column(nullable: true), CreatedDate = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_PasswordResetCodes", x => x.Id); }); migrationBuilder.CreateTable( name: "ProfileFederationCodes", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Code = table.Column(nullable: true), CreatedDate = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ProfileFederationCodes", x => x.Id); }); migrationBuilder.CreateTable( name: "MissionaryChild", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Name = table.Column(nullable: true), MissionarySupportId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_MissionaryChild", x => x.Id); table.ForeignKey( name: "FK_MissionaryChild_MissionarySupportForms_MissionarySupportId", column: x => x.MissionarySupportId, principalTable: "MissionarySupportForms", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "MissionaryCollegeRecommendation", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Name = table.Column(nullable: true), City = table.Column(nullable: true), State = table.Column(nullable: true), MissionarySupportId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_MissionaryCollegeRecommendation", x => x.Id); table.ForeignKey( name: "FK_MissionaryCollegeRecommendation_MissionarySupportForms_Missi~", column: x => x.MissionarySupportId, principalTable: "MissionarySupportForms", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "Profiles", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), ModifiedDate = table.Column(nullable: false), FirstName = table.Column(nullable: true), LastName = table.Column(nullable: true), Street = table.Column(nullable: true), City = table.Column(nullable: true), State = table.Column(nullable: true), Zip = table.Column(nullable: true), Country = table.Column(nullable: true), ProfileFederationCodeId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Profiles", x => x.Id); table.ForeignKey( name: "FK_Profiles_ProfileFederationCodes_ProfileFederationCodeId", column: x => x.ProfileFederationCodeId, principalTable: "ProfileFederationCodes", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "Users", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Email = table.Column(nullable: false), Password = table.Column(nullable: false), EmailVerifiedDate = table.Column(nullable: true), CreatedDate = table.Column(nullable: false), DeletedDate = table.Column(nullable: true), ProfileId = table.Column(nullable: true), EmailVerificationCodeId = table.Column(nullable: true), PassswordResetCodeId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); table.ForeignKey( name: "FK_Users_EmailVerificationCodes_EmailVerificationCodeId", column: x => x.EmailVerificationCodeId, principalTable: "EmailVerificationCodes", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_Users_PasswordResetCodes_PassswordResetCodeId", column: x => x.PassswordResetCodeId, principalTable: "PasswordResetCodes", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_Users_Profiles_ProfileId", column: x => x.ProfileId, principalTable: "Profiles", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_MissionaryChild_MissionarySupportId", table: "MissionaryChild", column: "MissionarySupportId"); migrationBuilder.CreateIndex( name: "IX_MissionaryCollegeRecommendation_MissionarySupportId", table: "MissionaryCollegeRecommendation", column: "MissionarySupportId"); migrationBuilder.CreateIndex( name: "IX_Profiles_ProfileFederationCodeId", table: "Profiles", column: "ProfileFederationCodeId"); migrationBuilder.CreateIndex( name: "IX_Users_Email", table: "Users", column: "Email"); migrationBuilder.CreateIndex( name: "IX_Users_EmailVerificationCodeId", table: "Users", column: "EmailVerificationCodeId"); migrationBuilder.CreateIndex( name: "IX_Users_PassswordResetCodeId", table: "Users", column: "PassswordResetCodeId"); migrationBuilder.CreateIndex( name: "IX_Users_ProfileId", table: "Users", column: "ProfileId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "MissionaryChild"); migrationBuilder.DropTable( name: "MissionaryCollegeRecommendation"); migrationBuilder.DropTable( name: "Users"); migrationBuilder.DropTable( name: "MissionarySupportForms"); migrationBuilder.DropTable( name: "EmailVerificationCodes"); migrationBuilder.DropTable( name: "PasswordResetCodes"); migrationBuilder.DropTable( name: "Profiles"); migrationBuilder.DropTable( name: "ProfileFederationCodes"); } } }