Refactor code formatting and improve readability: standardize line breaks and indentation across various endpoint files, enhancing code clarity and maintainability. Update package version formatting in Directory.Packages.props for consistency.

This commit is contained in:
Leonid Pershin
2026-07-25 19:55:01 +03:00
parent 1f6fa6f1ae
commit f57b7503ed
122 changed files with 1856 additions and 892 deletions
@@ -18,14 +18,23 @@ namespace TeleWave.Infrastructure.Migrations
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
IsSystem = table.Column<bool>(type: "boolean", nullable: false),
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true)
Name = table.Column<string>(
type: "character varying(256)",
maxLength: 256,
nullable: true
),
NormalizedName = table.Column<string>(
type: "character varying(256)",
maxLength: 256,
nullable: true
),
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true),
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoles", x => x.Id);
});
}
);
migrationBuilder.CreateTable(
name: "AspNetUsers",
@@ -33,11 +42,30 @@ namespace TeleWave.Infrastructure.Migrations
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
IsBlocked = table.Column<bool>(type: "boolean", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedUserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
Email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
CreatedAt = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
UserName = table.Column<string>(
type: "character varying(256)",
maxLength: 256,
nullable: true
),
NormalizedUserName = table.Column<string>(
type: "character varying(256)",
maxLength: 256,
nullable: true
),
Email = table.Column<string>(
type: "character varying(256)",
maxLength: 256,
nullable: true
),
NormalizedEmail = table.Column<string>(
type: "character varying(256)",
maxLength: 256,
nullable: true
),
EmailConfirmed = table.Column<bool>(type: "boolean", nullable: false),
PasswordHash = table.Column<string>(type: "text", nullable: true),
SecurityStamp = table.Column<string>(type: "text", nullable: true),
@@ -45,14 +73,18 @@ namespace TeleWave.Infrastructure.Migrations
PhoneNumber = table.Column<string>(type: "text", nullable: true),
PhoneNumberConfirmed = table.Column<bool>(type: "boolean", nullable: false),
TwoFactorEnabled = table.Column<bool>(type: "boolean", nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
LockoutEnd = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: true
),
LockoutEnabled = table.Column<bool>(type: "boolean", nullable: false),
AccessFailedCount = table.Column<int>(type: "integer", nullable: false)
AccessFailedCount = table.Column<int>(type: "integer", nullable: false),
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
});
}
);
migrationBuilder.CreateTable(
name: "RefreshTokens",
@@ -61,25 +93,39 @@ namespace TeleWave.Infrastructure.Migrations
Id = table.Column<Guid>(type: "uuid", nullable: false),
UserId = table.Column<Guid>(type: "uuid", nullable: false),
TokenHash = table.Column<string>(type: "text", nullable: false),
ExpiresAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
RevokedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
ReplacedByTokenHash = table.Column<string>(type: "text", nullable: true)
ExpiresAt = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
CreatedAt = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
RevokedAt = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: true
),
ReplacedByTokenHash = table.Column<string>(type: "text", nullable: true),
},
constraints: table =>
{
table.PrimaryKey("PK_RefreshTokens", x => x.Id);
});
}
);
migrationBuilder.CreateTable(
name: "AspNetRoleClaims",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Id = table
.Column<int>(type: "integer", nullable: false)
.Annotation(
"Npgsql:ValueGenerationStrategy",
NpgsqlValueGenerationStrategy.IdentityByDefaultColumn
),
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
ClaimType = table.Column<string>(type: "text", nullable: true),
ClaimValue = table.Column<string>(type: "text", nullable: true)
ClaimValue = table.Column<string>(type: "text", nullable: true),
},
constraints: table =>
{
@@ -89,18 +135,24 @@ namespace TeleWave.Infrastructure.Migrations
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
onDelete: ReferentialAction.Cascade
);
}
);
migrationBuilder.CreateTable(
name: "AspNetUserClaims",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Id = table
.Column<int>(type: "integer", nullable: false)
.Annotation(
"Npgsql:ValueGenerationStrategy",
NpgsqlValueGenerationStrategy.IdentityByDefaultColumn
),
UserId = table.Column<Guid>(type: "uuid", nullable: false),
ClaimType = table.Column<string>(type: "text", nullable: true),
ClaimValue = table.Column<string>(type: "text", nullable: true)
ClaimValue = table.Column<string>(type: "text", nullable: true),
},
constraints: table =>
{
@@ -110,8 +162,10 @@ namespace TeleWave.Infrastructure.Migrations
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
onDelete: ReferentialAction.Cascade
);
}
);
migrationBuilder.CreateTable(
name: "AspNetUserLogins",
@@ -120,25 +174,30 @@ namespace TeleWave.Infrastructure.Migrations
LoginProvider = table.Column<string>(type: "text", nullable: false),
ProviderKey = table.Column<string>(type: "text", nullable: false),
ProviderDisplayName = table.Column<string>(type: "text", nullable: true),
UserId = table.Column<Guid>(type: "uuid", nullable: false)
UserId = table.Column<Guid>(type: "uuid", nullable: false),
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
table.PrimaryKey(
"PK_AspNetUserLogins",
x => new { x.LoginProvider, x.ProviderKey }
);
table.ForeignKey(
name: "FK_AspNetUserLogins_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
onDelete: ReferentialAction.Cascade
);
}
);
migrationBuilder.CreateTable(
name: "AspNetUserRoles",
columns: table => new
{
UserId = table.Column<Guid>(type: "uuid", nullable: false),
RoleId = table.Column<Guid>(type: "uuid", nullable: false)
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
},
constraints: table =>
{
@@ -148,14 +207,17 @@ namespace TeleWave.Infrastructure.Migrations
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
onDelete: ReferentialAction.Cascade
);
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
onDelete: ReferentialAction.Cascade
);
}
);
migrationBuilder.CreateTable(
name: "AspNetUserTokens",
@@ -164,94 +226,105 @@ namespace TeleWave.Infrastructure.Migrations
UserId = table.Column<Guid>(type: "uuid", nullable: false),
LoginProvider = table.Column<string>(type: "text", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
Value = table.Column<string>(type: "text", nullable: true)
Value = table.Column<string>(type: "text", nullable: true),
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
table.PrimaryKey(
"PK_AspNetUserTokens",
x => new
{
x.UserId,
x.LoginProvider,
x.Name,
}
);
table.ForeignKey(
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
onDelete: ReferentialAction.Cascade
);
}
);
migrationBuilder.CreateIndex(
name: "IX_AspNetRoleClaims_RoleId",
table: "AspNetRoleClaims",
column: "RoleId");
column: "RoleId"
);
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "AspNetRoles",
column: "NormalizedName",
unique: true);
unique: true
);
migrationBuilder.CreateIndex(
name: "IX_AspNetUserClaims_UserId",
table: "AspNetUserClaims",
column: "UserId");
column: "UserId"
);
migrationBuilder.CreateIndex(
name: "IX_AspNetUserLogins_UserId",
table: "AspNetUserLogins",
column: "UserId");
column: "UserId"
);
migrationBuilder.CreateIndex(
name: "IX_AspNetUserRoles_RoleId",
table: "AspNetUserRoles",
column: "RoleId");
column: "RoleId"
);
migrationBuilder.CreateIndex(
name: "EmailIndex",
table: "AspNetUsers",
column: "NormalizedEmail");
column: "NormalizedEmail"
);
migrationBuilder.CreateIndex(
name: "UserNameIndex",
table: "AspNetUsers",
column: "NormalizedUserName",
unique: true);
unique: true
);
migrationBuilder.CreateIndex(
name: "IX_RefreshTokens_TokenHash",
table: "RefreshTokens",
column: "TokenHash",
unique: true);
unique: true
);
migrationBuilder.CreateIndex(
name: "IX_RefreshTokens_UserId",
table: "RefreshTokens",
column: "UserId");
column: "UserId"
);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AspNetRoleClaims");
migrationBuilder.DropTable(name: "AspNetRoleClaims");
migrationBuilder.DropTable(
name: "AspNetUserClaims");
migrationBuilder.DropTable(name: "AspNetUserClaims");
migrationBuilder.DropTable(
name: "AspNetUserLogins");
migrationBuilder.DropTable(name: "AspNetUserLogins");
migrationBuilder.DropTable(
name: "AspNetUserRoles");
migrationBuilder.DropTable(name: "AspNetUserRoles");
migrationBuilder.DropTable(
name: "AspNetUserTokens");
migrationBuilder.DropTable(name: "AspNetUserTokens");
migrationBuilder.DropTable(
name: "RefreshTokens");
migrationBuilder.DropTable(name: "RefreshTokens");
migrationBuilder.DropTable(
name: "AspNetRoles");
migrationBuilder.DropTable(name: "AspNetRoles");
migrationBuilder.DropTable(
name: "AspNetUsers");
migrationBuilder.DropTable(name: "AspNetUsers");
}
}
}
@@ -16,8 +16,16 @@ namespace TeleWave.Infrastructure.Migrations
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
OriginalFileName = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: false),
OriginalExtension = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: false),
OriginalFileName = table.Column<string>(
type: "character varying(512)",
maxLength: 512,
nullable: false
),
OriginalExtension = table.Column<string>(
type: "character varying(16)",
maxLength: 16,
nullable: false
),
Source = table.Column<int>(type: "integer", nullable: false),
Status = table.Column<int>(type: "integer", nullable: false),
Duration = table.Column<TimeSpan>(type: "interval", nullable: true),
@@ -25,34 +33,58 @@ namespace TeleWave.Infrastructure.Migrations
SegmentCount = table.Column<int>(type: "integer", nullable: true),
Width = table.Column<int>(type: "integer", nullable: true),
Height = table.Column<int>(type: "integer", nullable: true),
VideoCodec = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: true),
AudioCodec = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: true),
RelativePath = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
ErrorMessage = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
UpdatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
VideoCodec = table.Column<string>(
type: "character varying(32)",
maxLength: 32,
nullable: true
),
AudioCodec = table.Column<string>(
type: "character varying(32)",
maxLength: 32,
nullable: true
),
RelativePath = table.Column<string>(
type: "character varying(256)",
maxLength: 256,
nullable: true
),
ErrorMessage = table.Column<string>(
type: "character varying(2048)",
maxLength: 2048,
nullable: true
),
CreatedAt = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
UpdatedAt = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
},
constraints: table =>
{
table.PrimaryKey("PK_MediaAssets", x => x.Id);
});
}
);
migrationBuilder.CreateIndex(
name: "IX_MediaAssets_CreatedAt",
table: "MediaAssets",
column: "CreatedAt");
column: "CreatedAt"
);
migrationBuilder.CreateIndex(
name: "IX_MediaAssets_Status",
table: "MediaAssets",
column: "Status");
column: "Status"
);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "MediaAssets");
migrationBuilder.DropTable(name: "MediaAssets");
}
}
}
@@ -16,20 +16,35 @@ namespace TeleWave.Infrastructure.Migrations
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
Slug = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
Name = table.Column<string>(
type: "character varying(256)",
maxLength: 256,
nullable: false
),
Slug = table.Column<string>(
type: "character varying(128)",
maxLength: 128,
nullable: false
),
IsEnabled = table.Column<bool>(type: "boolean", nullable: false),
EpochUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
EpochUtc = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
AdInsertion = table.Column<int>(type: "integer", nullable: false),
AdsPerBreak = table.Column<int>(type: "integer", nullable: false),
FillerAssetId = table.Column<Guid>(type: "uuid", nullable: true),
NextAdIndex = table.Column<int>(type: "integer", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
CreatedAt = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
},
constraints: table =>
{
table.PrimaryKey("PK_Channels", x => x.Id);
});
}
);
migrationBuilder.CreateTable(
name: "ScheduleEntries",
@@ -39,30 +54,49 @@ namespace TeleWave.Infrastructure.Migrations
ChannelId = table.Column<Guid>(type: "uuid", nullable: false),
MediaAssetId = table.Column<Guid>(type: "uuid", nullable: false),
Kind = table.Column<int>(type: "integer", nullable: false),
StartsAtUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
EndsAtUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
StartsAtUtc = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
EndsAtUtc = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
ShowId = table.Column<Guid>(type: "uuid", nullable: true),
EpisodeIndex = table.Column<int>(type: "integer", nullable: true)
EpisodeIndex = table.Column<int>(type: "integer", nullable: true),
},
constraints: table =>
{
table.PrimaryKey("PK_ScheduleEntries", x => x.Id);
});
}
);
migrationBuilder.CreateTable(
name: "Shows",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
Description = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
Name = table.Column<string>(
type: "character varying(256)",
maxLength: 256,
nullable: false
),
Description = table.Column<string>(
type: "character varying(2048)",
maxLength: 2048,
nullable: true
),
Kind = table.Column<int>(type: "integer", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
CreatedAt = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
},
constraints: table =>
{
table.PrimaryKey("PK_Shows", x => x.Id);
});
}
);
migrationBuilder.CreateTable(
name: "ChannelAd",
@@ -71,7 +105,7 @@ namespace TeleWave.Infrastructure.Migrations
Id = table.Column<Guid>(type: "uuid", nullable: false),
ChannelId = table.Column<Guid>(type: "uuid", nullable: false),
MediaAssetId = table.Column<Guid>(type: "uuid", nullable: false),
Position = table.Column<int>(type: "integer", nullable: false)
Position = table.Column<int>(type: "integer", nullable: false),
},
constraints: table =>
{
@@ -81,8 +115,10 @@ namespace TeleWave.Infrastructure.Migrations
column: x => x.ChannelId,
principalTable: "Channels",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
onDelete: ReferentialAction.Cascade
);
}
);
migrationBuilder.CreateTable(
name: "ChannelShow",
@@ -95,7 +131,7 @@ namespace TeleWave.Infrastructure.Migrations
BlockMode = table.Column<int>(type: "integer", nullable: false),
BlockValue = table.Column<int>(type: "integer", nullable: false),
IsEnabled = table.Column<bool>(type: "boolean", nullable: false),
NextEpisodeIndex = table.Column<int>(type: "integer", nullable: false)
NextEpisodeIndex = table.Column<int>(type: "integer", nullable: false),
},
constraints: table =>
{
@@ -105,8 +141,10 @@ namespace TeleWave.Infrastructure.Migrations
column: x => x.ChannelId,
principalTable: "Channels",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
onDelete: ReferentialAction.Cascade
);
}
);
migrationBuilder.CreateTable(
name: "ProgrammingOverride",
@@ -115,8 +153,14 @@ namespace TeleWave.Infrastructure.Migrations
Id = table.Column<Guid>(type: "uuid", nullable: false),
ChannelId = table.Column<Guid>(type: "uuid", nullable: false),
Mode = table.Column<int>(type: "integer", nullable: false),
StartsAtUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
EndsAtUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
StartsAtUtc = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
EndsAtUtc = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
},
constraints: table =>
{
@@ -126,8 +170,10 @@ namespace TeleWave.Infrastructure.Migrations
column: x => x.ChannelId,
principalTable: "Channels",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
onDelete: ReferentialAction.Cascade
);
}
);
migrationBuilder.CreateTable(
name: "ShowEpisode",
@@ -137,7 +183,10 @@ namespace TeleWave.Infrastructure.Migrations
ShowId = table.Column<Guid>(type: "uuid", nullable: false),
MediaAssetId = table.Column<Guid>(type: "uuid", nullable: false),
Position = table.Column<int>(type: "integer", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
CreatedAt = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
},
constraints: table =>
{
@@ -147,8 +196,10 @@ namespace TeleWave.Infrastructure.Migrations
column: x => x.ShowId,
principalTable: "Shows",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
onDelete: ReferentialAction.Cascade
);
}
);
migrationBuilder.CreateTable(
name: "OverrideShow",
@@ -157,7 +208,7 @@ namespace TeleWave.Infrastructure.Migrations
Id = table.Column<Guid>(type: "uuid", nullable: false),
ProgrammingOverrideId = table.Column<Guid>(type: "uuid", nullable: false),
ShowId = table.Column<Guid>(type: "uuid", nullable: false),
Weight = table.Column<int>(type: "integer", nullable: false)
Weight = table.Column<int>(type: "integer", nullable: false),
},
constraints: table =>
{
@@ -167,87 +218,91 @@ namespace TeleWave.Infrastructure.Migrations
column: x => x.ProgrammingOverrideId,
principalTable: "ProgrammingOverride",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
onDelete: ReferentialAction.Cascade
);
}
);
migrationBuilder.CreateIndex(
name: "IX_ChannelAd_ChannelId_Position",
table: "ChannelAd",
columns: new[] { "ChannelId", "Position" });
columns: new[] { "ChannelId", "Position" }
);
migrationBuilder.CreateIndex(
name: "IX_Channels_Slug",
table: "Channels",
column: "Slug",
unique: true);
unique: true
);
migrationBuilder.CreateIndex(
name: "IX_ChannelShow_ChannelId_ShowId",
table: "ChannelShow",
columns: new[] { "ChannelId", "ShowId" });
columns: new[] { "ChannelId", "ShowId" }
);
migrationBuilder.CreateIndex(
name: "IX_OverrideShow_ProgrammingOverrideId",
table: "OverrideShow",
column: "ProgrammingOverrideId");
column: "ProgrammingOverrideId"
);
migrationBuilder.CreateIndex(
name: "IX_ProgrammingOverride_ChannelId_StartsAtUtc_EndsAtUtc",
table: "ProgrammingOverride",
columns: new[] { "ChannelId", "StartsAtUtc", "EndsAtUtc" });
columns: new[] { "ChannelId", "StartsAtUtc", "EndsAtUtc" }
);
migrationBuilder.CreateIndex(
name: "IX_ScheduleEntries_ChannelId_EndsAtUtc",
table: "ScheduleEntries",
columns: new[] { "ChannelId", "EndsAtUtc" });
columns: new[] { "ChannelId", "EndsAtUtc" }
);
migrationBuilder.CreateIndex(
name: "IX_ScheduleEntries_ChannelId_ShowId",
table: "ScheduleEntries",
columns: new[] { "ChannelId", "ShowId" });
columns: new[] { "ChannelId", "ShowId" }
);
migrationBuilder.CreateIndex(
name: "IX_ScheduleEntries_ChannelId_StartsAtUtc",
table: "ScheduleEntries",
columns: new[] { "ChannelId", "StartsAtUtc" });
columns: new[] { "ChannelId", "StartsAtUtc" }
);
migrationBuilder.CreateIndex(
name: "IX_ShowEpisode_MediaAssetId",
table: "ShowEpisode",
column: "MediaAssetId");
column: "MediaAssetId"
);
migrationBuilder.CreateIndex(
name: "IX_ShowEpisode_ShowId_Position",
table: "ShowEpisode",
columns: new[] { "ShowId", "Position" });
columns: new[] { "ShowId", "Position" }
);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ChannelAd");
migrationBuilder.DropTable(name: "ChannelAd");
migrationBuilder.DropTable(
name: "ChannelShow");
migrationBuilder.DropTable(name: "ChannelShow");
migrationBuilder.DropTable(
name: "OverrideShow");
migrationBuilder.DropTable(name: "OverrideShow");
migrationBuilder.DropTable(
name: "ScheduleEntries");
migrationBuilder.DropTable(name: "ScheduleEntries");
migrationBuilder.DropTable(
name: "ShowEpisode");
migrationBuilder.DropTable(name: "ShowEpisode");
migrationBuilder.DropTable(
name: "ProgrammingOverride");
migrationBuilder.DropTable(name: "ProgrammingOverride");
migrationBuilder.DropTable(
name: "Shows");
migrationBuilder.DropTable(name: "Shows");
migrationBuilder.DropTable(
name: "Channels");
migrationBuilder.DropTable(name: "Channels");
}
}
}
@@ -16,7 +16,8 @@ namespace TeleWave.Infrastructure.Migrations
table: "Channels",
type: "boolean",
nullable: false,
defaultValue: false);
defaultValue: false
);
migrationBuilder.CreateTable(
name: "BumperAssets",
@@ -25,30 +26,36 @@ namespace TeleWave.Infrastructure.Migrations
Id = table.Column<Guid>(type: "uuid", nullable: false),
FromShowId = table.Column<Guid>(type: "uuid", nullable: false),
ToShowId = table.Column<Guid>(type: "uuid", nullable: false),
Signature = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
Signature = table.Column<string>(
type: "character varying(128)",
maxLength: 128,
nullable: false
),
MediaAssetId = table.Column<Guid>(type: "uuid", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
CreatedAt = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
},
constraints: table =>
{
table.PrimaryKey("PK_BumperAssets", x => x.Id);
});
}
);
migrationBuilder.CreateIndex(
name: "IX_BumperAssets_FromShowId_ToShowId_Signature",
table: "BumperAssets",
columns: new[] { "FromShowId", "ToShowId", "Signature" });
columns: new[] { "FromShowId", "ToShowId", "Signature" }
);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "BumperAssets");
migrationBuilder.DropTable(name: "BumperAssets");
migrationBuilder.DropColumn(
name: "BumpersEnabled",
table: "Channels");
migrationBuilder.DropColumn(name: "BumpersEnabled", table: "Channels");
}
}
}
@@ -15,114 +15,104 @@ namespace TeleWave.Infrastructure.Migrations
table: "Channels",
type: "text",
nullable: false,
defaultValue: "0x38bdf8");
defaultValue: "0x38bdf8"
);
migrationBuilder.AddColumn<string>(
name: "BumperBackgroundColor",
table: "Channels",
type: "text",
nullable: false,
defaultValue: "0x0b1020");
defaultValue: "0x0b1020"
);
migrationBuilder.AddColumn<string>(
name: "BumperBackgroundColor2",
table: "Channels",
type: "text",
nullable: false,
defaultValue: "0x1e293b");
defaultValue: "0x1e293b"
);
migrationBuilder.AddColumn<int>(
name: "BumperDurationSeconds",
table: "Channels",
type: "integer",
nullable: false,
defaultValue: 8);
defaultValue: 8
);
migrationBuilder.AddColumn<int>(
name: "BumperFont",
table: "Channels",
type: "integer",
nullable: false,
defaultValue: 0);
defaultValue: 0
);
migrationBuilder.AddColumn<int>(
name: "BumperMinIntervalMinutes",
table: "Channels",
type: "integer",
nullable: false,
defaultValue: 0);
defaultValue: 0
);
migrationBuilder.AddColumn<string>(
name: "BumperNextLabel",
table: "Channels",
type: "text",
nullable: false,
defaultValue: "ДАЛЕЕ");
defaultValue: "ДАЛЕЕ"
);
migrationBuilder.AddColumn<string>(
name: "BumperNowLabel",
table: "Channels",
type: "text",
nullable: false,
defaultValue: "СЕЙЧАС");
defaultValue: "СЕЙЧАС"
);
migrationBuilder.AddColumn<bool>(
name: "BumperOnlyBetweenDifferentShows",
table: "Channels",
type: "boolean",
nullable: false,
defaultValue: true);
defaultValue: true
);
migrationBuilder.AddColumn<string>(
name: "BumperTextColor",
table: "Channels",
type: "text",
nullable: false,
defaultValue: "white");
defaultValue: "white"
);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "BumperAccentColor",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperAccentColor", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperBackgroundColor",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperBackgroundColor", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperBackgroundColor2",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperBackgroundColor2", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperDurationSeconds",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperDurationSeconds", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperFont",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperFont", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperMinIntervalMinutes",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperMinIntervalMinutes", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperNextLabel",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperNextLabel", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperNowLabel",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperNowLabel", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperOnlyBetweenDifferentShows",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperOnlyBetweenDifferentShows", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperTextColor",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperTextColor", table: "Channels");
}
}
}
@@ -15,34 +15,39 @@ namespace TeleWave.Infrastructure.Migrations
name: "BumperBackgroundExtension",
table: "Channels",
type: "text",
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<int>(
name: "BumperMode",
table: "Channels",
type: "integer",
nullable: false,
defaultValue: 0);
defaultValue: 0
);
migrationBuilder.AddColumn<string>(
name: "BumperMusicExtension",
table: "Channels",
type: "text",
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<int>(
name: "BumperRevision",
table: "Channels",
type: "integer",
nullable: false,
defaultValue: 0);
defaultValue: 0
);
migrationBuilder.AddColumn<int>(
name: "NextJingleIndex",
table: "Channels",
type: "integer",
nullable: false,
defaultValue: 0);
defaultValue: 0
);
migrationBuilder.CreateTable(
name: "ChannelJingle",
@@ -51,7 +56,7 @@ namespace TeleWave.Infrastructure.Migrations
Id = table.Column<Guid>(type: "uuid", nullable: false),
ChannelId = table.Column<Guid>(type: "uuid", nullable: false),
MediaAssetId = table.Column<Guid>(type: "uuid", nullable: false),
Position = table.Column<int>(type: "integer", nullable: false)
Position = table.Column<int>(type: "integer", nullable: false),
},
constraints: table =>
{
@@ -61,40 +66,32 @@ namespace TeleWave.Infrastructure.Migrations
column: x => x.ChannelId,
principalTable: "Channels",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
onDelete: ReferentialAction.Cascade
);
}
);
migrationBuilder.CreateIndex(
name: "IX_ChannelJingle_ChannelId_Position",
table: "ChannelJingle",
columns: new[] { "ChannelId", "Position" });
columns: new[] { "ChannelId", "Position" }
);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ChannelJingle");
migrationBuilder.DropTable(name: "ChannelJingle");
migrationBuilder.DropColumn(
name: "BumperBackgroundExtension",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperBackgroundExtension", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperMode",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperMode", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperMusicExtension",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperMusicExtension", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperRevision",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperRevision", table: "Channels");
migrationBuilder.DropColumn(
name: "NextJingleIndex",
table: "Channels");
migrationBuilder.DropColumn(name: "NextJingleIndex", table: "Channels");
}
}
}
@@ -14,20 +14,28 @@ namespace TeleWave.Infrastructure.Migrations
name: "AppSettings",
columns: table => new
{
Key = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
Value = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false)
Key = table.Column<string>(
type: "character varying(128)",
maxLength: 128,
nullable: false
),
Value = table.Column<string>(
type: "character varying(1024)",
maxLength: 1024,
nullable: false
),
},
constraints: table =>
{
table.PrimaryKey("PK_AppSettings", x => x.Key);
});
}
);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppSettings");
migrationBuilder.DropTable(name: "AppSettings");
}
}
}
@@ -15,47 +15,43 @@ namespace TeleWave.Infrastructure.Migrations
table: "Shows",
type: "character varying(64)",
maxLength: 64,
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<string>(
name: "MetadataProvider",
table: "Shows",
type: "character varying(16)",
maxLength: 16,
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<string>(
name: "PosterPath",
table: "Shows",
type: "character varying(256)",
maxLength: 256,
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<int>(
name: "Year",
table: "Shows",
type: "integer",
nullable: true);
nullable: true
);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "MetadataExternalId",
table: "Shows");
migrationBuilder.DropColumn(name: "MetadataExternalId", table: "Shows");
migrationBuilder.DropColumn(
name: "MetadataProvider",
table: "Shows");
migrationBuilder.DropColumn(name: "MetadataProvider", table: "Shows");
migrationBuilder.DropColumn(
name: "PosterPath",
table: "Shows");
migrationBuilder.DropColumn(name: "PosterPath", table: "Shows");
migrationBuilder.DropColumn(
name: "Year",
table: "Shows");
migrationBuilder.DropColumn(name: "Year", table: "Shows");
}
}
}
@@ -15,68 +15,62 @@ namespace TeleWave.Infrastructure.Migrations
name: "AirDate",
table: "ShowEpisode",
type: "date",
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<int>(
name: "Episode",
table: "ShowEpisode",
type: "integer",
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<string>(
name: "Overview",
table: "ShowEpisode",
type: "character varying(4096)",
maxLength: 4096,
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<int>(
name: "Season",
table: "ShowEpisode",
type: "integer",
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<string>(
name: "StillPath",
table: "ShowEpisode",
type: "character varying(256)",
maxLength: 256,
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<string>(
name: "Title",
table: "ShowEpisode",
type: "character varying(512)",
maxLength: 512,
nullable: true);
nullable: true
);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AirDate",
table: "ShowEpisode");
migrationBuilder.DropColumn(name: "AirDate", table: "ShowEpisode");
migrationBuilder.DropColumn(
name: "Episode",
table: "ShowEpisode");
migrationBuilder.DropColumn(name: "Episode", table: "ShowEpisode");
migrationBuilder.DropColumn(
name: "Overview",
table: "ShowEpisode");
migrationBuilder.DropColumn(name: "Overview", table: "ShowEpisode");
migrationBuilder.DropColumn(
name: "Season",
table: "ShowEpisode");
migrationBuilder.DropColumn(name: "Season", table: "ShowEpisode");
migrationBuilder.DropColumn(
name: "StillPath",
table: "ShowEpisode");
migrationBuilder.DropColumn(name: "StillPath", table: "ShowEpisode");
migrationBuilder.DropColumn(
name: "Title",
table: "ShowEpisode");
migrationBuilder.DropColumn(name: "Title", table: "ShowEpisode");
}
}
}
@@ -11,58 +11,41 @@ namespace TeleWave.Infrastructure.Migrations
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ChannelJingle");
migrationBuilder.DropTable(name: "ChannelJingle");
migrationBuilder.DropColumn(
name: "BumperAccentColor",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperAccentColor", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperBackgroundColor",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperBackgroundColor", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperBackgroundColor2",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperBackgroundColor2", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperBackgroundExtension",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperBackgroundExtension", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperDurationSeconds",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperDurationSeconds", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperMode",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperMode", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperMusicExtension",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperMusicExtension", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperTextColor",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperTextColor", table: "Channels");
migrationBuilder.RenameColumn(
name: "NextJingleIndex",
table: "Channels",
newName: "NextBumperIndex");
newName: "NextBumperIndex"
);
// Ревизия файлов уехала на блоки заставок — старый счётчик не переносим, стратегия по
// умолчанию Rotation (0).
migrationBuilder.DropColumn(
name: "BumperRevision",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperRevision", table: "Channels");
migrationBuilder.AddColumn<int>(
name: "BumperSelection",
table: "Channels",
type: "integer",
nullable: false,
defaultValue: 0);
defaultValue: 0
);
migrationBuilder.CreateTable(
name: "BumperTemplate",
@@ -71,16 +54,50 @@ namespace TeleWave.Infrastructure.Migrations
Id = table.Column<Guid>(type: "uuid", nullable: false),
ChannelId = table.Column<Guid>(type: "uuid", nullable: false),
Position = table.Column<int>(type: "integer", nullable: false),
Name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
BackgroundColor = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
BackgroundColor2 = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
AccentColor = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
TextColor = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
BackgroundImageExtension = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: true),
AudioExtension = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: true),
AudioDurationSeconds = table.Column<double>(type: "double precision", nullable: true),
Name = table.Column<string>(
type: "character varying(64)",
maxLength: 64,
nullable: false
),
BackgroundColor = table.Column<string>(
type: "character varying(32)",
maxLength: 32,
nullable: false
),
BackgroundColor2 = table.Column<string>(
type: "character varying(32)",
maxLength: 32,
nullable: false
),
AccentColor = table.Column<string>(
type: "character varying(32)",
maxLength: 32,
nullable: false
),
TextColor = table.Column<string>(
type: "character varying(32)",
maxLength: 32,
nullable: false
),
BackgroundImageExtension = table.Column<string>(
type: "character varying(16)",
maxLength: 16,
nullable: true
),
AudioExtension = table.Column<string>(
type: "character varying(16)",
maxLength: 16,
nullable: true
),
AudioDurationSeconds = table.Column<double>(
type: "double precision",
nullable: true
),
Revision = table.Column<int>(type: "integer", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
CreatedAt = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
},
constraints: table =>
{
@@ -90,13 +107,16 @@ namespace TeleWave.Infrastructure.Migrations
column: x => x.ChannelId,
principalTable: "Channels",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
onDelete: ReferentialAction.Cascade
);
}
);
migrationBuilder.CreateIndex(
name: "IX_BumperTemplate_ChannelId_Position",
table: "BumperTemplate",
columns: new[] { "ChannelId", "Position" });
columns: new[] { "ChannelId", "Position" }
);
// Каждому существующему каналу — дефолтный блок заставки (Position 0, без звука/фона).
migrationBuilder.Sql(
@@ -114,78 +134,85 @@ namespace TeleWave.Infrastructure.Migrations
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "BumperTemplate");
migrationBuilder.DropTable(name: "BumperTemplate");
migrationBuilder.RenameColumn(
name: "NextBumperIndex",
table: "Channels",
newName: "NextJingleIndex");
newName: "NextJingleIndex"
);
migrationBuilder.DropColumn(
name: "BumperSelection",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperSelection", table: "Channels");
migrationBuilder.AddColumn<int>(
name: "BumperRevision",
table: "Channels",
type: "integer",
nullable: false,
defaultValue: 0);
defaultValue: 0
);
migrationBuilder.AddColumn<string>(
name: "BumperAccentColor",
table: "Channels",
type: "text",
nullable: false,
defaultValue: "");
defaultValue: ""
);
migrationBuilder.AddColumn<string>(
name: "BumperBackgroundColor",
table: "Channels",
type: "text",
nullable: false,
defaultValue: "");
defaultValue: ""
);
migrationBuilder.AddColumn<string>(
name: "BumperBackgroundColor2",
table: "Channels",
type: "text",
nullable: false,
defaultValue: "");
defaultValue: ""
);
migrationBuilder.AddColumn<string>(
name: "BumperBackgroundExtension",
table: "Channels",
type: "text",
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<int>(
name: "BumperDurationSeconds",
table: "Channels",
type: "integer",
nullable: false,
defaultValue: 0);
defaultValue: 0
);
migrationBuilder.AddColumn<int>(
name: "BumperMode",
table: "Channels",
type: "integer",
nullable: false,
defaultValue: 0);
defaultValue: 0
);
migrationBuilder.AddColumn<string>(
name: "BumperMusicExtension",
table: "Channels",
type: "text",
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<string>(
name: "BumperTextColor",
table: "Channels",
type: "text",
nullable: false,
defaultValue: "");
defaultValue: ""
);
migrationBuilder.CreateTable(
name: "ChannelJingle",
@@ -194,7 +221,7 @@ namespace TeleWave.Infrastructure.Migrations
Id = table.Column<Guid>(type: "uuid", nullable: false),
ChannelId = table.Column<Guid>(type: "uuid", nullable: false),
MediaAssetId = table.Column<Guid>(type: "uuid", nullable: false),
Position = table.Column<int>(type: "integer", nullable: false)
Position = table.Column<int>(type: "integer", nullable: false),
},
constraints: table =>
{
@@ -204,13 +231,16 @@ namespace TeleWave.Infrastructure.Migrations
column: x => x.ChannelId,
principalTable: "Channels",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
onDelete: ReferentialAction.Cascade
);
}
);
migrationBuilder.CreateIndex(
name: "IX_ChannelJingle_ChannelId_Position",
table: "ChannelJingle",
columns: new[] { "ChannelId", "Position" });
columns: new[] { "ChannelId", "Position" }
);
}
}
}
@@ -14,15 +14,14 @@ namespace TeleWave.Infrastructure.Migrations
name: "OriginalName",
table: "Shows",
type: "text",
nullable: true);
nullable: true
);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "OriginalName",
table: "Shows");
migrationBuilder.DropColumn(name: "OriginalName", table: "Shows");
}
}
}
@@ -17,26 +17,38 @@ namespace TeleWave.Infrastructure.Migrations
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Category = table.Column<int>(type: "integer", nullable: false),
FileExtension = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: false),
OriginalFileName = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
FileExtension = table.Column<string>(
type: "character varying(16)",
maxLength: 16,
nullable: false
),
OriginalFileName = table.Column<string>(
type: "character varying(512)",
maxLength: 512,
nullable: true
),
CreatedAt = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
},
constraints: table =>
{
table.PrimaryKey("PK_Images", x => x.Id);
});
}
);
migrationBuilder.CreateIndex(
name: "IX_Images_Category_CreatedAt",
table: "Images",
columns: new[] { "Category", "CreatedAt" });
columns: new[] { "Category", "CreatedAt" }
);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Images");
migrationBuilder.DropTable(name: "Images");
}
}
}
@@ -19,13 +19,15 @@ namespace TeleWave.Infrastructure.Migrations
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
oldNullable: true
);
migrationBuilder.AddColumn<Guid>(
name: "PosterImageId",
table: "Shows",
type: "uuid",
nullable: true);
nullable: true
);
// Переносим существующие постеры шоу в общий реестр изображений: на каждый постер —
// запись Images (Category=1 ShowPoster) с расширением из старого пути; файлы перекладывает
@@ -45,17 +47,13 @@ namespace TeleWave.Infrastructure.Migrations
"""
);
migrationBuilder.DropColumn(
name: "PosterPath",
table: "Shows");
migrationBuilder.DropColumn(name: "PosterPath", table: "Shows");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PosterImageId",
table: "Shows");
migrationBuilder.DropColumn(name: "PosterImageId", table: "Shows");
migrationBuilder.AlterColumn<string>(
name: "OriginalName",
@@ -65,14 +63,16 @@ namespace TeleWave.Infrastructure.Migrations
oldClrType: typeof(string),
oldType: "character varying(256)",
oldMaxLength: 256,
oldNullable: true);
oldNullable: true
);
migrationBuilder.AddColumn<string>(
name: "PosterPath",
table: "Shows",
type: "character varying(256)",
maxLength: 256,
nullable: true);
nullable: true
);
}
}
}
@@ -15,13 +15,15 @@ namespace TeleWave.Infrastructure.Migrations
name: "StillImageId",
table: "ShowEpisode",
type: "uuid",
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<Guid>(
name: "BackgroundImageId",
table: "BumperTemplate",
type: "uuid",
nullable: true);
nullable: true
);
// Кадры серий → реестр (Category=2 EpisodeStill); файлы перекладывает RelocateLegacyImagesAsync.
migrationBuilder.Sql(
@@ -55,39 +57,33 @@ namespace TeleWave.Infrastructure.Migrations
"""
);
migrationBuilder.DropColumn(
name: "StillPath",
table: "ShowEpisode");
migrationBuilder.DropColumn(name: "StillPath", table: "ShowEpisode");
migrationBuilder.DropColumn(
name: "BackgroundImageExtension",
table: "BumperTemplate");
migrationBuilder.DropColumn(name: "BackgroundImageExtension", table: "BumperTemplate");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "StillImageId",
table: "ShowEpisode");
migrationBuilder.DropColumn(name: "StillImageId", table: "ShowEpisode");
migrationBuilder.DropColumn(
name: "BackgroundImageId",
table: "BumperTemplate");
migrationBuilder.DropColumn(name: "BackgroundImageId", table: "BumperTemplate");
migrationBuilder.AddColumn<string>(
name: "StillPath",
table: "ShowEpisode",
type: "character varying(256)",
maxLength: 256,
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<string>(
name: "BackgroundImageExtension",
table: "BumperTemplate",
type: "character varying(16)",
maxLength: 16,
nullable: true);
nullable: true
);
}
}
}
@@ -18,14 +18,37 @@ namespace TeleWave.Infrastructure.Migrations
Id = table.Column<Guid>(type: "uuid", nullable: false),
BumperTemplateId = table.Column<Guid>(type: "uuid", nullable: false),
Position = table.Column<int>(type: "integer", nullable: false),
Name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
Name = table.Column<string>(
type: "character varying(64)",
maxLength: 64,
nullable: false
),
Kind = table.Column<int>(type: "integer", nullable: false),
NowLabel = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
NextLabel = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
Line1 = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
Line2 = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
NowLabel = table.Column<string>(
type: "character varying(64)",
maxLength: 64,
nullable: false
),
NextLabel = table.Column<string>(
type: "character varying(64)",
maxLength: 64,
nullable: false
),
Line1 = table.Column<string>(
type: "character varying(120)",
maxLength: 120,
nullable: false
),
Line2 = table.Column<string>(
type: "character varying(120)",
maxLength: 120,
nullable: false
),
Trigger = table.Column<int>(type: "integer", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
CreatedAt = table.Column<DateTimeOffset>(
type: "timestamp with time zone",
nullable: false
),
},
constraints: table =>
{
@@ -35,13 +58,16 @@ namespace TeleWave.Infrastructure.Migrations
column: x => x.BumperTemplateId,
principalTable: "BumperTemplate",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
onDelete: ReferentialAction.Cascade
);
}
);
migrationBuilder.CreateIndex(
name: "IX_BumperTextVariant_BumperTemplateId_Position",
table: "BumperTextVariant",
columns: new[] { "BumperTemplateId", "Position" });
columns: new[] { "BumperTemplateId", "Position" }
);
// Каждому блоку — дефолтный подблок «Сейчас/Далее» с прежними подписями канала; правило
// показа переносим из старой галочки (только на смене шоу → OnShowChange=0, иначе Both=2).
@@ -75,29 +101,31 @@ namespace TeleWave.Infrastructure.Migrations
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "BumperTextVariant");
migrationBuilder.DropTable(name: "BumperTextVariant");
migrationBuilder.AddColumn<string>(
name: "BumperNextLabel",
table: "Channels",
type: "text",
nullable: false,
defaultValue: "");
defaultValue: ""
);
migrationBuilder.AddColumn<string>(
name: "BumperNowLabel",
table: "Channels",
type: "text",
nullable: false,
defaultValue: "");
defaultValue: ""
);
migrationBuilder.AddColumn<bool>(
name: "BumperOnlyBetweenDifferentShows",
table: "Channels",
type: "boolean",
nullable: false,
defaultValue: false);
defaultValue: false
);
}
}
}
@@ -13,26 +13,28 @@ namespace TeleWave.Infrastructure.Migrations
{
migrationBuilder.DropForeignKey(
name: "FK_BumperTextVariant_BumperTemplate_BumperTemplateId",
table: "BumperTextVariant");
table: "BumperTextVariant"
);
migrationBuilder.DropPrimaryKey(
name: "PK_BumperTextVariant",
table: "BumperTextVariant");
table: "BumperTextVariant"
);
migrationBuilder.RenameTable(
name: "BumperTextVariant",
newName: "BumperTextVariants");
migrationBuilder.RenameTable(name: "BumperTextVariant", newName: "BumperTextVariants");
migrationBuilder.RenameIndex(
name: "IX_BumperTextVariant_BumperTemplateId_Position",
table: "BumperTextVariants",
newName: "IX_BumperTextVariants_BumperTemplateId_Position");
newName: "IX_BumperTextVariants_BumperTemplateId_Position"
);
migrationBuilder.AddColumn<Guid>(
name: "BumperVariantId",
table: "ScheduleEntries",
type: "uuid",
nullable: true);
nullable: true
);
// Существующим каналам — 1.0 (заставка на каждом подходящем переходе, как было до фичи).
migrationBuilder.AddColumn<double>(
@@ -40,26 +42,30 @@ namespace TeleWave.Infrastructure.Migrations
table: "Channels",
type: "double precision",
nullable: false,
defaultValue: 1.0);
defaultValue: 1.0
);
migrationBuilder.AddColumn<double>(
name: "BumperShowChangeChance",
table: "Channels",
type: "double precision",
nullable: false,
defaultValue: 1.0);
defaultValue: 1.0
);
migrationBuilder.AddColumn<int>(
name: "Weight",
table: "BumperTextVariants",
type: "integer",
nullable: false,
defaultValue: 1);
defaultValue: 1
);
migrationBuilder.AddPrimaryKey(
name: "PK_BumperTextVariants",
table: "BumperTextVariants",
column: "Id");
column: "Id"
);
migrationBuilder.AddForeignKey(
name: "FK_BumperTextVariants_BumperTemplate_BumperTemplateId",
@@ -67,7 +73,8 @@ namespace TeleWave.Infrastructure.Migrations
column: "BumperTemplateId",
principalTable: "BumperTemplate",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
onDelete: ReferentialAction.Cascade
);
}
/// <inheritdoc />
@@ -75,41 +82,35 @@ namespace TeleWave.Infrastructure.Migrations
{
migrationBuilder.DropForeignKey(
name: "FK_BumperTextVariants_BumperTemplate_BumperTemplateId",
table: "BumperTextVariants");
table: "BumperTextVariants"
);
migrationBuilder.DropPrimaryKey(
name: "PK_BumperTextVariants",
table: "BumperTextVariants");
table: "BumperTextVariants"
);
migrationBuilder.DropColumn(
name: "BumperVariantId",
table: "ScheduleEntries");
migrationBuilder.DropColumn(name: "BumperVariantId", table: "ScheduleEntries");
migrationBuilder.DropColumn(
name: "BumperEpisodeChangeChance",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperEpisodeChangeChance", table: "Channels");
migrationBuilder.DropColumn(
name: "BumperShowChangeChance",
table: "Channels");
migrationBuilder.DropColumn(name: "BumperShowChangeChance", table: "Channels");
migrationBuilder.DropColumn(
name: "Weight",
table: "BumperTextVariants");
migrationBuilder.DropColumn(name: "Weight", table: "BumperTextVariants");
migrationBuilder.RenameTable(
name: "BumperTextVariants",
newName: "BumperTextVariant");
migrationBuilder.RenameTable(name: "BumperTextVariants", newName: "BumperTextVariant");
migrationBuilder.RenameIndex(
name: "IX_BumperTextVariants_BumperTemplateId_Position",
table: "BumperTextVariant",
newName: "IX_BumperTextVariant_BumperTemplateId_Position");
newName: "IX_BumperTextVariant_BumperTemplateId_Position"
);
migrationBuilder.AddPrimaryKey(
name: "PK_BumperTextVariant",
table: "BumperTextVariant",
column: "Id");
column: "Id"
);
migrationBuilder.AddForeignKey(
name: "FK_BumperTextVariant_BumperTemplate_BumperTemplateId",
@@ -117,7 +118,8 @@ namespace TeleWave.Infrastructure.Migrations
column: "BumperTemplateId",
principalTable: "BumperTemplate",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
onDelete: ReferentialAction.Cascade
);
}
}
}
@@ -16,7 +16,8 @@ namespace TeleWave.Infrastructure.Migrations
table: "ChannelShow",
type: "integer",
nullable: false,
defaultValue: 3);
defaultValue: 3
);
migrationBuilder.CreateTable(
name: "ChannelShowHour",
@@ -25,7 +26,7 @@ namespace TeleWave.Infrastructure.Migrations
Id = table.Column<Guid>(type: "uuid", nullable: false),
ChannelShowId = table.Column<Guid>(type: "uuid", nullable: false),
StartHour = table.Column<int>(type: "integer", nullable: false),
EndHour = table.Column<int>(type: "integer", nullable: false)
EndHour = table.Column<int>(type: "integer", nullable: false),
},
constraints: table =>
{
@@ -35,24 +36,24 @@ namespace TeleWave.Infrastructure.Migrations
column: x => x.ChannelShowId,
principalTable: "ChannelShow",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
onDelete: ReferentialAction.Cascade
);
}
);
migrationBuilder.CreateIndex(
name: "IX_ChannelShowHour_ChannelShowId",
table: "ChannelShowHour",
column: "ChannelShowId");
column: "ChannelShowId"
);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ChannelShowHour");
migrationBuilder.DropTable(name: "ChannelShowHour");
migrationBuilder.DropColumn(
name: "PreferredWeightMultiplier",
table: "ChannelShow");
migrationBuilder.DropColumn(name: "PreferredWeightMultiplier", table: "ChannelShow");
}
}
}
@@ -17,7 +17,8 @@ namespace TeleWave.Infrastructure.Migrations
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTimeOffset),
oldType: "timestamp with time zone");
oldType: "timestamp with time zone"
);
migrationBuilder.AlterColumn<DateTimeOffset>(
name: "EndsAtUtc",
@@ -25,72 +26,77 @@ namespace TeleWave.Infrastructure.Migrations
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTimeOffset),
oldType: "timestamp with time zone");
oldType: "timestamp with time zone"
);
migrationBuilder.AddColumn<int>(
name: "DayOfWeek",
table: "ProgrammingOverride",
type: "integer",
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<int>(
name: "EndMinute",
table: "ProgrammingOverride",
type: "integer",
nullable: true);
nullable: true
);
migrationBuilder.AddColumn<int>(
name: "Recurrence",
table: "ProgrammingOverride",
type: "integer",
nullable: false,
defaultValue: 0);
defaultValue: 0
);
migrationBuilder.AddColumn<int>(
name: "StartMinute",
table: "ProgrammingOverride",
type: "integer",
nullable: true);
nullable: true
);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DayOfWeek",
table: "ProgrammingOverride");
migrationBuilder.DropColumn(name: "DayOfWeek", table: "ProgrammingOverride");
migrationBuilder.DropColumn(
name: "EndMinute",
table: "ProgrammingOverride");
migrationBuilder.DropColumn(name: "EndMinute", table: "ProgrammingOverride");
migrationBuilder.DropColumn(
name: "Recurrence",
table: "ProgrammingOverride");
migrationBuilder.DropColumn(name: "Recurrence", table: "ProgrammingOverride");
migrationBuilder.DropColumn(
name: "StartMinute",
table: "ProgrammingOverride");
migrationBuilder.DropColumn(name: "StartMinute", table: "ProgrammingOverride");
migrationBuilder.AlterColumn<DateTimeOffset>(
name: "StartsAtUtc",
table: "ProgrammingOverride",
type: "timestamp with time zone",
nullable: false,
defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
defaultValue: new DateTimeOffset(
new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
new TimeSpan(0, 0, 0, 0, 0)
),
oldClrType: typeof(DateTimeOffset),
oldType: "timestamp with time zone",
oldNullable: true);
oldNullable: true
);
migrationBuilder.AlterColumn<DateTimeOffset>(
name: "EndsAtUtc",
table: "ProgrammingOverride",
type: "timestamp with time zone",
nullable: false,
defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
defaultValue: new DateTimeOffset(
new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
new TimeSpan(0, 0, 0, 0, 0)
),
oldClrType: typeof(DateTimeOffset),
oldType: "timestamp with time zone",
oldNullable: true);
oldNullable: true
);
}
}
}