290 lines
14 KiB
C#
290 lines
14 KiB
C#
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<int>(nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Code = table.Column<string>(nullable: true),
|
|
CreatedDate = table.Column<DateTime>(nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_EmailVerificationCodes", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "MissionarySupportForms",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Name = table.Column<string>(nullable: true),
|
|
HomePhone = table.Column<string>(nullable: true),
|
|
CellPhone = table.Column<string>(nullable: true),
|
|
FieldPhone = table.Column<string>(nullable: true),
|
|
WifesName = table.Column<string>(nullable: true),
|
|
Testimony = table.Column<string>(nullable: true),
|
|
CallToField = table.Column<string>(nullable: true),
|
|
SendingChurch = table.Column<string>(nullable: true),
|
|
FieldOfService = table.Column<string>(nullable: true),
|
|
Plans = table.Column<string>(nullable: true),
|
|
EvaluationOfNationals = table.Column<string>(nullable: true),
|
|
TimeInCountry = table.Column<string>(nullable: true),
|
|
CorrectWrongOfAnotherMissionary = table.Column<string>(nullable: true),
|
|
FinancialStatementPrevYear = table.Column<string>(nullable: true),
|
|
CurrentMonthlySupport = table.Column<string>(nullable: true),
|
|
MonthlySupportNeeded = table.Column<string>(nullable: true),
|
|
RestAndRelaxation = table.Column<string>(nullable: true),
|
|
AloneOrTeam = table.Column<string>(nullable: true),
|
|
ChildrenSchool = table.Column<int>(nullable: false),
|
|
Dance = table.Column<bool>(nullable: false),
|
|
WorldlyMusic = table.Column<bool>(nullable: false),
|
|
MovieTheaters = table.Column<bool>(nullable: false),
|
|
Alcohol = table.Column<bool>(nullable: false),
|
|
Smoking = table.Column<bool>(nullable: false),
|
|
MaleHair = table.Column<bool>(nullable: false),
|
|
FemaleSlacks = table.Column<int>(nullable: false),
|
|
FemaleShorts = table.Column<int>(nullable: false),
|
|
FemaleDressStandard = table.Column<bool>(nullable: false),
|
|
SwimmingClothing = table.Column<string>(nullable: true),
|
|
Television = table.Column<string>(nullable: true),
|
|
DailyBible = table.Column<int>(nullable: false),
|
|
NumberLedToChrist = table.Column<double>(nullable: false),
|
|
NumberWitnessedTo = table.Column<double>(nullable: false),
|
|
NumberWeeklyTracts = table.Column<double>(nullable: false),
|
|
RateOfSuccess = table.Column<string>(nullable: true),
|
|
Predestination = table.Column<string>(nullable: true),
|
|
FellowshipAssociation = table.Column<string>(nullable: true),
|
|
AdmittedWrong = table.Column<string>(nullable: true),
|
|
Divorced = table.Column<bool>(nullable: false),
|
|
GroundsForRemarry = table.Column<bool>(nullable: false),
|
|
MarryADivorcee = table.Column<bool>(nullable: false),
|
|
MasonicLodge = table.Column<bool>(nullable: false),
|
|
BibleVersionsUsed = table.Column<string>(nullable: true),
|
|
BibleVersionOpinion = table.Column<string>(nullable: true),
|
|
ContemporaryMusic = table.Column<bool>(nullable: false),
|
|
Charasmaticism = table.Column<string>(nullable: true),
|
|
Tongues = table.Column<bool>(nullable: false),
|
|
RepentanceNecessary = table.Column<bool>(nullable: false),
|
|
RepentanceDefinition = table.Column<string>(nullable: true),
|
|
Fundamentalist = table.Column<bool>(nullable: false),
|
|
BillsOnTime = table.Column<string>(nullable: true),
|
|
LateBills = table.Column<string>(nullable: true),
|
|
LateBillActionTaken = table.Column<string>(nullable: true),
|
|
PotentialHarvest = table.Column<string>(nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_MissionarySupportForms", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "PasswordResetCodes",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Code = table.Column<string>(nullable: true),
|
|
CreatedDate = table.Column<DateTime>(nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_PasswordResetCodes", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "ProfileFederationCodes",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Code = table.Column<string>(nullable: true),
|
|
CreatedDate = table.Column<DateTime>(nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_ProfileFederationCodes", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "MissionaryChild",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Name = table.Column<string>(nullable: true),
|
|
MissionarySupportId = table.Column<int>(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<int>(nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Name = table.Column<string>(nullable: true),
|
|
City = table.Column<string>(nullable: true),
|
|
State = table.Column<string>(nullable: true),
|
|
MissionarySupportId = table.Column<int>(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<int>(nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
ModifiedDate = table.Column<DateTime>(nullable: false),
|
|
FirstName = table.Column<string>(nullable: true),
|
|
LastName = table.Column<string>(nullable: true),
|
|
Street = table.Column<string>(nullable: true),
|
|
City = table.Column<string>(nullable: true),
|
|
State = table.Column<string>(nullable: true),
|
|
Zip = table.Column<string>(nullable: true),
|
|
Country = table.Column<string>(nullable: true),
|
|
ProfileFederationCodeId = table.Column<int>(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<int>(nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Email = table.Column<string>(nullable: false),
|
|
Password = table.Column<string>(nullable: false),
|
|
EmailVerifiedDate = table.Column<DateTime>(nullable: true),
|
|
CreatedDate = table.Column<DateTime>(nullable: false),
|
|
DeletedDate = table.Column<DateTime>(nullable: true),
|
|
ProfileId = table.Column<int>(nullable: true),
|
|
EmailVerificationCodeId = table.Column<int>(nullable: true),
|
|
PassswordResetCodeId = table.Column<int>(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");
|
|
}
|
|
}
|
|
}
|