| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321 | using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace UnivateProperties_API.Migrations
{
    public partial class IsDeleted : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Weeks",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Users",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "UserDefinedGroups",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "UserDefinedFields",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "UnitConfigurationTypes",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "UnitConfigurations",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Suburbs",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Status",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Seasons",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "SearchLogs",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Provinces",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "PropertyUserFields",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "PropertyTypes",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "PropertyImages",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Properties",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "ProcessFlows",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Individuals",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Hosts",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Emails",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Cities",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "BidItems",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Banks",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "BankAccounts",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Agents",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Agencies",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Addresses",
                nullable: false,
                defaultValue: false);
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Accounts",
                nullable: false,
                defaultValue: false);
            migrationBuilder.CreateTable(
                name: "Person",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
                    Created = table.Column<DateTime>(nullable: false),
                    Modified = table.Column<DateTime>(nullable: false),
                    ModifiedBy = table.Column<string>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    UserId = table.Column<int>(nullable: true),
                    Name = table.Column<string>(nullable: true),
                    Surname = table.Column<string>(nullable: true),
                    Email = table.Column<string>(nullable: true),
                    Telephone = table.Column<string>(nullable: true),
                    CellNumber = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Person", x => x.Id);
                    table.ForeignKey(
                        name: "FK_Person_Users_UserId",
                        column: x => x.UserId,
                        principalTable: "Users",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Restrict);
                });
            migrationBuilder.CreateIndex(
                name: "IX_Person_UserId",
                table: "Person",
                column: "UserId");
        }
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Person");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Weeks");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Users");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "UserDefinedGroups");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "UserDefinedFields");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "UnitConfigurationTypes");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "UnitConfigurations");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Suburbs");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Status");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Seasons");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "SearchLogs");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Provinces");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "PropertyUserFields");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "PropertyTypes");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "PropertyImages");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Properties");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "ProcessFlows");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Individuals");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Hosts");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Emails");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Cities");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "BidItems");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Banks");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "BankAccounts");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Agents");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Agencies");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Addresses");
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Accounts");
        }
    }
}
 |