API
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20200121103350_PaymentsTable.cs 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
  4. namespace UnivateProperties_API.Migrations
  5. {
  6. public partial class PaymentsTable : Migration
  7. {
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.CreateTable(
  11. name: "Payments",
  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. IsDeleted = table.Column<bool>(nullable: false),
  20. TimeshareWeekId = table.Column<int>(nullable: true),
  21. PropertyId = table.Column<int>(nullable: true),
  22. Amount = table.Column<decimal>(nullable: false),
  23. PaymentStatus = table.Column<string>(nullable: true)
  24. },
  25. constraints: table =>
  26. {
  27. table.PrimaryKey("PK_Payments", x => x.Id);
  28. table.ForeignKey(
  29. name: "FK_Payments_Properties_PropertyId",
  30. column: x => x.PropertyId,
  31. principalTable: "Properties",
  32. principalColumn: "Id",
  33. onDelete: ReferentialAction.Restrict);
  34. table.ForeignKey(
  35. name: "FK_Payments_Weeks_TimeshareWeekId",
  36. column: x => x.TimeshareWeekId,
  37. principalTable: "Weeks",
  38. principalColumn: "Id",
  39. onDelete: ReferentialAction.Restrict);
  40. });
  41. migrationBuilder.CreateIndex(
  42. name: "IX_Payments_PropertyId",
  43. table: "Payments",
  44. column: "PropertyId");
  45. migrationBuilder.CreateIndex(
  46. name: "IX_Payments_TimeshareWeekId",
  47. table: "Payments",
  48. column: "TimeshareWeekId");
  49. }
  50. protected override void Down(MigrationBuilder migrationBuilder)
  51. {
  52. migrationBuilder.DropTable(
  53. name: "Payments");
  54. }
  55. }
  56. }