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.

20200122063527_ExtraPaymentFields.cs 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. namespace UnivateProperties_API.Migrations
  3. {
  4. public partial class ExtraPaymentFields : Migration
  5. {
  6. protected override void Up(MigrationBuilder migrationBuilder)
  7. {
  8. migrationBuilder.AddColumn<int>(
  9. name: "CreatedById",
  10. table: "Payments",
  11. nullable: false,
  12. defaultValue: 0);
  13. migrationBuilder.AddColumn<string>(
  14. name: "PaymentToken",
  15. table: "Payments",
  16. nullable: true);
  17. migrationBuilder.CreateIndex(
  18. name: "IX_Payments_CreatedById",
  19. table: "Payments",
  20. column: "CreatedById");
  21. migrationBuilder.AddForeignKey(
  22. name: "FK_Payments_Users_CreatedById",
  23. table: "Payments",
  24. column: "CreatedById",
  25. principalTable: "Users",
  26. principalColumn: "Id",
  27. onDelete: ReferentialAction.Cascade);
  28. }
  29. protected override void Down(MigrationBuilder migrationBuilder)
  30. {
  31. migrationBuilder.DropForeignKey(
  32. name: "FK_Payments_Users_CreatedById",
  33. table: "Payments");
  34. migrationBuilder.DropIndex(
  35. name: "IX_Payments_CreatedById",
  36. table: "Payments");
  37. migrationBuilder.DropColumn(
  38. name: "CreatedById",
  39. table: "Payments");
  40. migrationBuilder.DropColumn(
  41. name: "PaymentToken",
  42. table: "Payments");
  43. }
  44. }
  45. }