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(nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn), Created = table.Column(nullable: false), Modified = table.Column(nullable: false), ModifiedBy = table.Column(nullable: true), Amount = table.Column(nullable: false), StatusId = table.Column(nullable: true), BidMakerId = table.Column(nullable: true), TimeshareWeekId = table.Column(nullable: true), PropertyId = table.Column(nullable: true), Comment = table.Column(nullable: true), DeclinedReason = table.Column(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"); } } }