using Microsoft.EntityFrameworkCore.Migrations;

namespace UnivateProperties_API.Migrations
{
    public partial class PropertyAddressesupdated : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "CityId",
                table: "Properties");

            migrationBuilder.DropColumn(
                name: "ProvinceId",
                table: "Properties");

            migrationBuilder.DropColumn(
                name: "SuburbId",
                table: "Properties");

            migrationBuilder.RenameColumn(
                name: "AddressLine3",
                table: "Properties",
                newName: "Suburb");

            migrationBuilder.RenameColumn(
                name: "AddressLine2",
                table: "Properties",
                newName: "StreetNumber");

            migrationBuilder.RenameColumn(
                name: "AddressLine1",
                table: "Properties",
                newName: "StreetName");

            migrationBuilder.AddColumn<string>(
                name: "AddressOther",
                table: "Properties",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "City",
                table: "Properties",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Country",
                table: "Properties",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "PostalCode",
                table: "Properties",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Province",
                table: "Properties",
                nullable: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "AddressOther",
                table: "Properties");

            migrationBuilder.DropColumn(
                name: "City",
                table: "Properties");

            migrationBuilder.DropColumn(
                name: "Country",
                table: "Properties");

            migrationBuilder.DropColumn(
                name: "PostalCode",
                table: "Properties");

            migrationBuilder.DropColumn(
                name: "Province",
                table: "Properties");

            migrationBuilder.RenameColumn(
                name: "Suburb",
                table: "Properties",
                newName: "AddressLine3");

            migrationBuilder.RenameColumn(
                name: "StreetNumber",
                table: "Properties",
                newName: "AddressLine2");

            migrationBuilder.RenameColumn(
                name: "StreetName",
                table: "Properties",
                newName: "AddressLine1");

            migrationBuilder.AddColumn<int>(
                name: "CityId",
                table: "Properties",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "ProvinceId",
                table: "Properties",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "SuburbId",
                table: "Properties",
                nullable: false,
                defaultValue: 0);
        }
    }
}