20260326154300_AddYouTubeFieldsToChannel.cs 3.2 KB

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