using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Church.Net.DAL.EFCoreDBF.Migrations { public partial class AddMissingColumn : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "LogoImage", table: "PastoralDomains", type: "text", nullable: true); migrationBuilder.AddColumn( name: "ServiceAddressId", table: "PastoralDomains", type: "text", nullable: true); migrationBuilder.AlterColumn( name: "Password", table: "FamilyMembers", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "Email", table: "FamilyMembers", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "DateOfWalkIn", table: "FamilyMembers", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "Birthday", table: "FamilyMembers", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AddColumn( name: "Baptized", table: "FamilyMembers", type: "boolean", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "Comment", table: "FamilyMembers", type: "text", nullable: true); migrationBuilder.CreateTable( name: "AddressInfos", columns: table => new { Id = table.Column(type: "text", nullable: false), Address = table.Column(type: "text", nullable: true), City = table.Column(type: "text", nullable: true), State = table.Column(type: "text", nullable: true), Zip = table.Column(type: "text", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AddressInfos", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_PastoralDomains_ServiceAddressId", table: "PastoralDomains", column: "ServiceAddressId"); migrationBuilder.AddForeignKey( name: "FK_PastoralDomains_AddressInfos_ServiceAddressId", table: "PastoralDomains", column: "ServiceAddressId", principalTable: "AddressInfos", principalColumn: "Id"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_PastoralDomains_AddressInfos_ServiceAddressId", table: "PastoralDomains"); migrationBuilder.DropTable( name: "AddressInfos"); migrationBuilder.DropIndex( name: "IX_PastoralDomains_ServiceAddressId", table: "PastoralDomains"); migrationBuilder.DropColumn( name: "LogoImage", table: "PastoralDomains"); migrationBuilder.DropColumn( name: "ServiceAddressId", table: "PastoralDomains"); migrationBuilder.DropColumn( name: "Baptized", table: "FamilyMembers"); migrationBuilder.DropColumn( name: "Comment", table: "FamilyMembers"); migrationBuilder.AlterColumn( name: "Password", table: "FamilyMembers", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "Email", table: "FamilyMembers", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "DateOfWalkIn", table: "FamilyMembers", type: "timestamp with time zone", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "Birthday", table: "FamilyMembers", type: "timestamp with time zone", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); } } }