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.

20201030070202_addFieldsToPayments1.cs 1.6KB

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