| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 | using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace UnivateProperties_API.Migrations
{
    public partial class Process : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "BidItems",
                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),
                    Amount = table.Column<double>(nullable: false),
                    StatusId = table.Column<int>(nullable: true),
                    BidMakerId = table.Column<int>(nullable: true),
                    TimeshareWeekId = table.Column<int>(nullable: true),
                    PropertyId = table.Column<int>(nullable: true),
                    Comment = table.Column<string>(nullable: true),
                    DeclinedReason = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BidItems", x => x.Id);
                    table.ForeignKey(
                        name: "FK_BidItems_Individuals_BidMakerId",
                        column: x => x.BidMakerId,
                        principalTable: "Individuals",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_BidItems_Properties_PropertyId",
                        column: x => x.PropertyId,
                        principalTable: "Properties",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_BidItems_Status_StatusId",
                        column: x => x.StatusId,
                        principalTable: "Status",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_BidItems_Weeks_TimeshareWeekId",
                        column: x => x.TimeshareWeekId,
                        principalTable: "Weeks",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Restrict);
                });
            migrationBuilder.CreateIndex(
                name: "IX_BidItems_BidMakerId",
                table: "BidItems",
                column: "BidMakerId");
            migrationBuilder.CreateIndex(
                name: "IX_BidItems_PropertyId",
                table: "BidItems",
                column: "PropertyId");
            migrationBuilder.CreateIndex(
                name: "IX_BidItems_StatusId",
                table: "BidItems",
                column: "StatusId");
            migrationBuilder.CreateIndex(
                name: "IX_BidItems_TimeshareWeekId",
                table: "BidItems",
                column: "TimeshareWeekId");
        }
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "BidItems");
        }
    }
}
 |