20170921032209_AddCreatDate.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using Microsoft.EntityFrameworkCore.Metadata;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. using System;
  4. using System.Collections.Generic;
  5. namespace Winsoft.GOV.XF.WebApi.WXCore.Migrations
  6. {
  7. public partial class AddCreatDate : Migration
  8. {
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.AddColumn<DateTime>(
  12. name: "CreateDate",
  13. table: "WXUser",
  14. type: "datetime(6)",
  15. nullable: false,
  16. defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified))
  17. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
  18. migrationBuilder.AddColumn<DateTime>(
  19. name: "CreateDate",
  20. table: "Bundle",
  21. type: "datetime(6)",
  22. nullable: false,
  23. defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified))
  24. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
  25. migrationBuilder.AddColumn<int>(
  26. name: "UserId",
  27. table: "Bundle",
  28. type: "int",
  29. nullable: false,
  30. defaultValue: 0);
  31. migrationBuilder.AddColumn<DateTime>(
  32. name: "CreateDate",
  33. table: "Asset",
  34. type: "datetime(6)",
  35. nullable: false,
  36. defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified))
  37. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
  38. }
  39. protected override void Down(MigrationBuilder migrationBuilder)
  40. {
  41. migrationBuilder.DropColumn(
  42. name: "CreateDate",
  43. table: "WXUser");
  44. migrationBuilder.DropColumn(
  45. name: "CreateDate",
  46. table: "Bundle");
  47. migrationBuilder.DropColumn(
  48. name: "UserId",
  49. table: "Bundle");
  50. migrationBuilder.DropColumn(
  51. name: "CreateDate",
  52. table: "Asset");
  53. }
  54. }
  55. }