API
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

20190906105051_Process.cs 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
  4. namespace UnivateProperties_API.Migrations
  5. {
  6. public partial class Process : Migration
  7. {
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.CreateTable(
  11. name: "BidItems",
  12. columns: table => new
  13. {
  14. Id = table.Column<int>(nullable: false)
  15. .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn),
  16. Created = table.Column<DateTime>(nullable: false),
  17. Modified = table.Column<DateTime>(nullable: false),
  18. ModifiedBy = table.Column<string>(nullable: true),
  19. Amount = table.Column<double>(nullable: false),
  20. StatusId = table.Column<int>(nullable: true),
  21. BidMakerId = table.Column<int>(nullable: true),
  22. TimeshareWeekId = table.Column<int>(nullable: true),
  23. PropertyId = table.Column<int>(nullable: true),
  24. Comment = table.Column<string>(nullable: true),
  25. DeclinedReason = table.Column<string>(nullable: true)
  26. },
  27. constraints: table =>
  28. {
  29. table.PrimaryKey("PK_BidItems", x => x.Id);
  30. table.ForeignKey(
  31. name: "FK_BidItems_Individuals_BidMakerId",
  32. column: x => x.BidMakerId,
  33. principalTable: "Individuals",
  34. principalColumn: "Id",
  35. onDelete: ReferentialAction.Restrict);
  36. table.ForeignKey(
  37. name: "FK_BidItems_Properties_PropertyId",
  38. column: x => x.PropertyId,
  39. principalTable: "Properties",
  40. principalColumn: "Id",
  41. onDelete: ReferentialAction.Restrict);
  42. table.ForeignKey(
  43. name: "FK_BidItems_Status_StatusId",
  44. column: x => x.StatusId,
  45. principalTable: "Status",
  46. principalColumn: "Id",
  47. onDelete: ReferentialAction.Restrict);
  48. table.ForeignKey(
  49. name: "FK_BidItems_Weeks_TimeshareWeekId",
  50. column: x => x.TimeshareWeekId,
  51. principalTable: "Weeks",
  52. principalColumn: "Id",
  53. onDelete: ReferentialAction.Restrict);
  54. });
  55. migrationBuilder.CreateIndex(
  56. name: "IX_BidItems_BidMakerId",
  57. table: "BidItems",
  58. column: "BidMakerId");
  59. migrationBuilder.CreateIndex(
  60. name: "IX_BidItems_PropertyId",
  61. table: "BidItems",
  62. column: "PropertyId");
  63. migrationBuilder.CreateIndex(
  64. name: "IX_BidItems_StatusId",
  65. table: "BidItems",
  66. column: "StatusId");
  67. migrationBuilder.CreateIndex(
  68. name: "IX_BidItems_TimeshareWeekId",
  69. table: "BidItems",
  70. column: "TimeshareWeekId");
  71. }
  72. protected override void Down(MigrationBuilder migrationBuilder)
  73. {
  74. migrationBuilder.DropTable(
  75. name: "BidItems");
  76. }
  77. }
  78. }