using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace OmsorgCore.Infrastructure.Persistence.Migrations
{
    /// <inheritdoc />
    public partial class RenameEmployeeAddressToStructuredFields : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "Address",
                table: "employees",
                newName: "Street");

            migrationBuilder.AddColumn<string>(
                name: "City",
                table: "employees",
                type: "character varying(100)",
                maxLength: 100,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Country",
                table: "employees",
                type: "character varying(100)",
                maxLength: 100,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "PostalCode",
                table: "employees",
                type: "character varying(10)",
                maxLength: 10,
                nullable: true);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "City",
                table: "employees");

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

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

            migrationBuilder.RenameColumn(
                name: "Street",
                table: "employees",
                newName: "Address");
        }
    }
}
