20260326154300_AddYouTubeFieldsToChannel.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace Infrastructure.Migrations.AppDb;
  5. /// <inheritdoc />
  6. public partial class AddYouTubeFieldsToChannel : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.AddColumn<string>(
  12. name: "BannerUrl",
  13. table: "Channel",
  14. type: "nvarchar(max)",
  15. nullable: true);
  16. migrationBuilder.AddColumn<string>(
  17. name: "Description",
  18. table: "Channel",
  19. type: "nvarchar(max)",
  20. nullable: true);
  21. migrationBuilder.AddColumn<string>(
  22. name: "Email",
  23. table: "Channel",
  24. type: "nvarchar(max)",
  25. nullable: true);
  26. migrationBuilder.AddColumn<long>(
  27. name: "SubscriberCount",
  28. table: "Channel",
  29. type: "bigint",
  30. nullable: false,
  31. defaultValue: 0L);
  32. migrationBuilder.AddColumn<string>(
  33. name: "ThumbnailUrl",
  34. table: "Channel",
  35. type: "nvarchar(max)",
  36. nullable: true);
  37. migrationBuilder.AddColumn<long>(
  38. name: "VideoCount",
  39. table: "Channel",
  40. type: "bigint",
  41. nullable: false,
  42. defaultValue: 0L);
  43. migrationBuilder.AddColumn<long>(
  44. name: "ViewCount",
  45. table: "Channel",
  46. type: "bigint",
  47. nullable: false,
  48. defaultValue: 0L);
  49. migrationBuilder.AddColumn<string>(
  50. name: "YouTubeChannelID",
  51. table: "Channel",
  52. type: "nvarchar(max)",
  53. nullable: true);
  54. migrationBuilder.AddColumn<DateTime>(
  55. name: "YouTubePublishedAt",
  56. table: "Channel",
  57. type: "datetime2",
  58. nullable: true);
  59. }
  60. /// <inheritdoc />
  61. protected override void Down(MigrationBuilder migrationBuilder)
  62. {
  63. migrationBuilder.DropColumn(
  64. name: "BannerUrl",
  65. table: "Channel");
  66. migrationBuilder.DropColumn(
  67. name: "Description",
  68. table: "Channel");
  69. migrationBuilder.DropColumn(
  70. name: "Email",
  71. table: "Channel");
  72. migrationBuilder.DropColumn(
  73. name: "SubscriberCount",
  74. table: "Channel");
  75. migrationBuilder.DropColumn(
  76. name: "ThumbnailUrl",
  77. table: "Channel");
  78. migrationBuilder.DropColumn(
  79. name: "VideoCount",
  80. table: "Channel");
  81. migrationBuilder.DropColumn(
  82. name: "ViewCount",
  83. table: "Channel");
  84. migrationBuilder.DropColumn(
  85. name: "YouTubeChannelID",
  86. table: "Channel");
  87. migrationBuilder.DropColumn(
  88. name: "YouTubePublishedAt",
  89. table: "Channel");
  90. }
  91. }