Enhance code readability and maintainability by refactoring various components. Update formatting commands in CLAUDE.md for csharpier integration. Simplify method signatures in SegmentFiles, UploadLimits, and multiple endpoint classes for improved clarity. Adjust query handlers and command handlers to streamline parameter handling and enhance consistency across the application.
This commit is contained in:
@@ -60,9 +60,7 @@ public sealed class MaintenanceBackgroundService(
|
||||
// Осиротевшей считается заставка, чей ассет не встречается ни в одной записи расписания.
|
||||
// Границу по времени не ставим: окно хранения расписания уже определяет, что живо.
|
||||
var removed = await db
|
||||
.BumperAssets.Where(b =>
|
||||
!db.ScheduleEntries.Any(e => e.MediaAssetId == b.MediaAssetId)
|
||||
)
|
||||
.BumperAssets.Where(b => !db.ScheduleEntries.Any(e => e.MediaAssetId == b.MediaAssetId))
|
||||
.ExecuteDeleteAsync(cancellationToken);
|
||||
|
||||
if (removed > 0)
|
||||
|
||||
@@ -41,8 +41,8 @@ internal sealed class BumperRenderBackgroundService(
|
||||
{
|
||||
try
|
||||
{
|
||||
var spec = await WithScopeAsync<BumperSpecLoader, BumperRenderSpec?>(
|
||||
loader => loader.LoadAsync(job.AssetId, cancellationToken)
|
||||
var spec = await WithScopeAsync<BumperSpecLoader, BumperRenderSpec?>(loader =>
|
||||
loader.LoadAsync(job.AssetId, cancellationToken)
|
||||
);
|
||||
if (spec is null)
|
||||
{
|
||||
|
||||
@@ -156,12 +156,7 @@ internal abstract class MediaClaimingBackgroundService<TJob>(
|
||||
Guid assetId,
|
||||
string error,
|
||||
CancellationToken cancellationToken
|
||||
) =>
|
||||
await WithAssetAsync(
|
||||
assetId,
|
||||
asset => asset.MarkFailed(error),
|
||||
cancellationToken
|
||||
);
|
||||
) => await WithAssetAsync(assetId, asset => asset.MarkFailed(error), cancellationToken);
|
||||
|
||||
/// <summary>Находит ассет в свежем scope, применяет к нему изменение и сохраняет.</summary>
|
||||
protected async Task WithAssetAsync(
|
||||
|
||||
@@ -48,7 +48,11 @@ internal sealed class MediaProcessingBackgroundService(
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = await processor.ProcessAsync(job.AssetId, job.Extension, cancellationToken);
|
||||
var result = await processor.ProcessAsync(
|
||||
job.AssetId,
|
||||
job.Extension,
|
||||
cancellationToken
|
||||
);
|
||||
await WithAssetAsync(
|
||||
job.AssetId,
|
||||
asset =>
|
||||
|
||||
@@ -16,16 +16,28 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
||||
Slug = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
|
||||
Name = table.Column<string>(
|
||||
type: "character varying(128)",
|
||||
maxLength: 128,
|
||||
nullable: false
|
||||
),
|
||||
Slug = table.Column<string>(
|
||||
type: "character varying(64)",
|
||||
maxLength: 64,
|
||||
nullable: false
|
||||
),
|
||||
SortOrder = table.Column<int>(type: "integer", nullable: false),
|
||||
IsSystem = table.Column<bool>(type: "boolean", 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_Genres", x => x.Id);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GenreAliases",
|
||||
@@ -33,7 +45,11 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
GenreId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Value = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false)
|
||||
Value = table.Column<string>(
|
||||
type: "character varying(128)",
|
||||
maxLength: 128,
|
||||
nullable: false
|
||||
),
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -43,8 +59,10 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
column: x => x.GenreId,
|
||||
principalTable: "Genres",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ShowGenres",
|
||||
@@ -52,7 +70,7 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
{
|
||||
ShowId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
GenreId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
IsPrimary = table.Column<bool>(type: "boolean", nullable: false)
|
||||
IsPrimary = table.Column<bool>(type: "boolean", nullable: false),
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -62,49 +80,53 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
column: x => x.GenreId,
|
||||
principalTable: "Genres",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
onDelete: ReferentialAction.Restrict
|
||||
);
|
||||
table.ForeignKey(
|
||||
name: "FK_ShowGenres_Shows_ShowId",
|
||||
column: x => x.ShowId,
|
||||
principalTable: "Shows",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GenreAliases_GenreId",
|
||||
table: "GenreAliases",
|
||||
column: "GenreId");
|
||||
column: "GenreId"
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GenreAliases_Value",
|
||||
table: "GenreAliases",
|
||||
column: "Value",
|
||||
unique: true);
|
||||
unique: true
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Genres_Slug",
|
||||
table: "Genres",
|
||||
column: "Slug",
|
||||
unique: true);
|
||||
unique: true
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ShowGenres_GenreId",
|
||||
table: "ShowGenres",
|
||||
column: "GenreId");
|
||||
column: "GenreId"
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "GenreAliases");
|
||||
migrationBuilder.DropTable(name: "GenreAliases");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ShowGenres");
|
||||
migrationBuilder.DropTable(name: "ShowGenres");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Genres");
|
||||
migrationBuilder.DropTable(name: "Genres");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,15 +16,27 @@ 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),
|
||||
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
|
||||
),
|
||||
PosterImageId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
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_Collections", x => x.Id);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CollectionItems",
|
||||
@@ -33,7 +45,7 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
CollectionId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ShowId = 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 =>
|
||||
{
|
||||
@@ -43,40 +55,44 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
column: x => x.CollectionId,
|
||||
principalTable: "Collections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
table.ForeignKey(
|
||||
name: "FK_CollectionItems_Shows_ShowId",
|
||||
column: x => x.ShowId,
|
||||
principalTable: "Shows",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CollectionItems_CollectionId_Position",
|
||||
table: "CollectionItems",
|
||||
columns: new[] { "CollectionId", "Position" });
|
||||
columns: new[] { "CollectionId", "Position" }
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CollectionItems_CollectionId_ShowId",
|
||||
table: "CollectionItems",
|
||||
columns: new[] { "CollectionId", "ShowId" },
|
||||
unique: true);
|
||||
unique: true
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CollectionItems_ShowId",
|
||||
table: "CollectionItems",
|
||||
column: "ShowId");
|
||||
column: "ShowId"
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "CollectionItems");
|
||||
migrationBuilder.DropTable(name: "CollectionItems");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Collections");
|
||||
migrationBuilder.DropTable(name: "Collections");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,19 +16,34 @@ 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),
|
||||
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
|
||||
),
|
||||
FilterJson = table.Column<string>(type: "jsonb", nullable: true),
|
||||
ItemCount = table.Column<int>(type: "integer", nullable: false),
|
||||
UnitCount = table.Column<int>(type: "integer", nullable: false),
|
||||
TotalDuration = table.Column<TimeSpan>(type: "interval", nullable: false),
|
||||
StatsComputedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
||||
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
|
||||
StatsComputedAt = table.Column<DateTimeOffset>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: true
|
||||
),
|
||||
CreatedAt = table.Column<DateTimeOffset>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: false
|
||||
),
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Groups", x => x.Id);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GroupItems",
|
||||
@@ -39,7 +54,7 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
ElementKind = table.Column<int>(type: "integer", nullable: false),
|
||||
ElementId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Weight = table.Column<int>(type: "integer", nullable: false),
|
||||
Position = table.Column<int>(type: "integer", nullable: false)
|
||||
Position = table.Column<int>(type: "integer", nullable: false),
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -49,34 +64,37 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
column: x => x.GroupId,
|
||||
principalTable: "Groups",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GroupItems_ElementKind_ElementId",
|
||||
table: "GroupItems",
|
||||
columns: new[] { "ElementKind", "ElementId" });
|
||||
columns: new[] { "ElementKind", "ElementId" }
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GroupItems_GroupId_ElementKind_ElementId",
|
||||
table: "GroupItems",
|
||||
columns: new[] { "GroupId", "ElementKind", "ElementId" },
|
||||
unique: true);
|
||||
unique: true
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GroupItems_GroupId_Position",
|
||||
table: "GroupItems",
|
||||
columns: new[] { "GroupId", "Position" });
|
||||
columns: new[] { "GroupId", "Position" }
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "GroupItems");
|
||||
migrationBuilder.DropTable(name: "GroupItems");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Groups");
|
||||
migrationBuilder.DropTable(name: "Groups");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+69
-48
@@ -16,26 +16,30 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
table: "Channels",
|
||||
type: "time without time zone",
|
||||
nullable: false,
|
||||
defaultValue: new TimeOnly(0, 0, 0));
|
||||
defaultValue: new TimeOnly(0, 0, 0)
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Number",
|
||||
table: "Channels",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
nullable: true
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "TemplateId",
|
||||
table: "Channels",
|
||||
type: "uuid",
|
||||
nullable: true);
|
||||
nullable: true
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "UtcOffsetMinutes",
|
||||
table: "Channels",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
defaultValue: 0
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ScheduleTemplates",
|
||||
@@ -43,16 +47,24 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ChannelId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||
Name = table.Column<string>(
|
||||
type: "character varying(256)",
|
||||
maxLength: 256,
|
||||
nullable: false
|
||||
),
|
||||
FallbackGroupId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
Revision = table.Column<int>(type: "integer", nullable: false),
|
||||
AppliedRevision = 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_ScheduleTemplates", x => x.Id);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GridLayers",
|
||||
@@ -60,11 +72,15 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
TemplateId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
||||
Name = table.Column<string>(
|
||||
type: "character varying(128)",
|
||||
maxLength: 128,
|
||||
nullable: false
|
||||
),
|
||||
Priority = table.Column<int>(type: "integer", nullable: false),
|
||||
ApplicabilityJson = table.Column<string>(type: "jsonb", nullable: true),
|
||||
IsEnabled = table.Column<bool>(type: "boolean", nullable: false),
|
||||
IsBackground = table.Column<bool>(type: "boolean", nullable: false)
|
||||
IsBackground = table.Column<bool>(type: "boolean", nullable: false),
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -74,8 +90,10 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
column: x => x.TemplateId,
|
||||
principalTable: "ScheduleTemplates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Slots",
|
||||
@@ -84,9 +102,16 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
LayerId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Weekday = table.Column<int>(type: "integer", nullable: true),
|
||||
TargetStart = table.Column<TimeOnly>(type: "time without time zone", nullable: false),
|
||||
TargetStart = table.Column<TimeOnly>(
|
||||
type: "time without time zone",
|
||||
nullable: false
|
||||
),
|
||||
TargetDurationMinutes = table.Column<int>(type: "integer", nullable: false),
|
||||
Title = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||
Title = table.Column<string>(
|
||||
type: "character varying(256)",
|
||||
maxLength: 256,
|
||||
nullable: false
|
||||
),
|
||||
Daypart = table.Column<int>(type: "integer", nullable: false),
|
||||
SlotKind = table.Column<int>(type: "integer", nullable: false),
|
||||
GroupId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
@@ -97,7 +122,7 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
OverflowPolicy = table.Column<int>(type: "integer", nullable: false),
|
||||
IsAnchor = table.Column<bool>(type: "boolean", nullable: false),
|
||||
MaxDriftMinutes = table.Column<int>(type: "integer", nullable: false),
|
||||
SnapToMinutes = table.Column<int>(type: "integer", nullable: true)
|
||||
SnapToMinutes = table.Column<int>(type: "integer", nullable: true),
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -107,14 +132,17 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
column: x => x.LayerId,
|
||||
principalTable: "GridLayers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
table.ForeignKey(
|
||||
name: "FK_Slots_Groups_GroupId",
|
||||
column: x => x.GroupId,
|
||||
principalTable: "Groups",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
onDelete: ReferentialAction.Restrict
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SlotStates",
|
||||
@@ -123,7 +151,7 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
SlotId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
CurrentElementKind = table.Column<int>(type: "integer", nullable: true),
|
||||
CurrentElementId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
NextUnitIndex = table.Column<int>(type: "integer", nullable: false)
|
||||
NextUnitIndex = table.Column<int>(type: "integer", nullable: false),
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -133,71 +161,64 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
column: x => x.SlotId,
|
||||
principalTable: "Slots",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Channels_Number",
|
||||
table: "Channels",
|
||||
column: "Number",
|
||||
unique: true,
|
||||
filter: "\"Number\" IS NOT NULL");
|
||||
filter: "\"Number\" IS NOT NULL"
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GridLayers_TemplateId_Priority",
|
||||
table: "GridLayers",
|
||||
columns: new[] { "TemplateId", "Priority" });
|
||||
columns: new[] { "TemplateId", "Priority" }
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ScheduleTemplates_ChannelId",
|
||||
table: "ScheduleTemplates",
|
||||
column: "ChannelId");
|
||||
column: "ChannelId"
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Slots_GroupId",
|
||||
table: "Slots",
|
||||
column: "GroupId");
|
||||
column: "GroupId"
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Slots_LayerId_TargetStart",
|
||||
table: "Slots",
|
||||
columns: new[] { "LayerId", "TargetStart" });
|
||||
columns: new[] { "LayerId", "TargetStart" }
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "SlotStates");
|
||||
migrationBuilder.DropTable(name: "SlotStates");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Slots");
|
||||
migrationBuilder.DropTable(name: "Slots");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "GridLayers");
|
||||
migrationBuilder.DropTable(name: "GridLayers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ScheduleTemplates");
|
||||
migrationBuilder.DropTable(name: "ScheduleTemplates");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Channels_Number",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropIndex(name: "IX_Channels_Number", table: "Channels");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DayStartTime",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "DayStartTime", table: "Channels");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Number",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "Number", table: "Channels");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TemplateId",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "TemplateId", table: "Channels");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UtcOffsetMinutes",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "UtcOffsetMinutes", table: "Channels");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+14
-12
@@ -13,24 +13,28 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ScheduleEntries_ChannelId_ShowId",
|
||||
table: "ScheduleEntries");
|
||||
table: "ScheduleEntries"
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "SlotId",
|
||||
table: "ScheduleEntries",
|
||||
type: "uuid",
|
||||
nullable: true);
|
||||
nullable: true
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "TraceJson",
|
||||
table: "ScheduleEntries",
|
||||
type: "jsonb",
|
||||
nullable: true);
|
||||
nullable: true
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ScheduleEntries_ChannelId_ShowId_StartsAtUtc",
|
||||
table: "ScheduleEntries",
|
||||
columns: new[] { "ChannelId", "ShowId", "StartsAtUtc" });
|
||||
columns: new[] { "ChannelId", "ShowId", "StartsAtUtc" }
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -38,20 +42,18 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ScheduleEntries_ChannelId_ShowId_StartsAtUtc",
|
||||
table: "ScheduleEntries");
|
||||
table: "ScheduleEntries"
|
||||
);
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SlotId",
|
||||
table: "ScheduleEntries");
|
||||
migrationBuilder.DropColumn(name: "SlotId", table: "ScheduleEntries");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TraceJson",
|
||||
table: "ScheduleEntries");
|
||||
migrationBuilder.DropColumn(name: "TraceJson", table: "ScheduleEntries");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ScheduleEntries_ChannelId_ShowId",
|
||||
table: "ScheduleEntries",
|
||||
columns: new[] { "ChannelId", "ShowId" });
|
||||
columns: new[] { "ChannelId", "ShowId" }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+61
-44
@@ -11,32 +11,21 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ChannelAd");
|
||||
migrationBuilder.DropTable(name: "ChannelAd");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ChannelShowHour");
|
||||
migrationBuilder.DropTable(name: "ChannelShowHour");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "OverrideShow");
|
||||
migrationBuilder.DropTable(name: "OverrideShow");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ChannelShow");
|
||||
migrationBuilder.DropTable(name: "ChannelShow");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ProgrammingOverride");
|
||||
migrationBuilder.DropTable(name: "ProgrammingOverride");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AdInsertion",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "AdInsertion", table: "Channels");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AdsPerBreak",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "AdsPerBreak", table: "Channels");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "NextAdIndex",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "NextAdIndex", table: "Channels");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -47,21 +36,24 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
table: "Channels",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
defaultValue: 0
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "AdsPerBreak",
|
||||
table: "Channels",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
defaultValue: 0
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "NextAdIndex",
|
||||
table: "Channels",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
defaultValue: 0
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ChannelAd",
|
||||
@@ -70,7 +62,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 =>
|
||||
{
|
||||
@@ -80,8 +72,10 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
column: x => x.ChannelId,
|
||||
principalTable: "Channels",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ChannelShow",
|
||||
@@ -93,9 +87,13 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
ChannelId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
IsEnabled = table.Column<bool>(type: "boolean", nullable: false),
|
||||
NextEpisodeIndex = table.Column<int>(type: "integer", nullable: false),
|
||||
PreferredWeightMultiplier = table.Column<int>(type: "integer", nullable: false, defaultValue: 3),
|
||||
PreferredWeightMultiplier = table.Column<int>(
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 3
|
||||
),
|
||||
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 =>
|
||||
{
|
||||
@@ -105,8 +103,10 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
column: x => x.ChannelId,
|
||||
principalTable: "Channels",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ProgrammingOverride",
|
||||
@@ -116,11 +116,17 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
ChannelId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
DayOfWeek = table.Column<int>(type: "integer", nullable: true),
|
||||
EndMinute = table.Column<int>(type: "integer", nullable: true),
|
||||
EndsAtUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
||||
EndsAtUtc = table.Column<DateTimeOffset>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: true
|
||||
),
|
||||
Mode = table.Column<int>(type: "integer", nullable: false),
|
||||
Recurrence = table.Column<int>(type: "integer", nullable: false),
|
||||
StartMinute = table.Column<int>(type: "integer", nullable: true),
|
||||
StartsAtUtc = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
|
||||
StartsAtUtc = table.Column<DateTimeOffset>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: true
|
||||
),
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -130,8 +136,10 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
column: x => x.ChannelId,
|
||||
principalTable: "Channels",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ChannelShowHour",
|
||||
@@ -140,7 +148,7 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ChannelShowId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
EndHour = table.Column<int>(type: "integer", nullable: false),
|
||||
StartHour = table.Column<int>(type: "integer", nullable: false)
|
||||
StartHour = table.Column<int>(type: "integer", nullable: false),
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -150,8 +158,10 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
column: x => x.ChannelShowId,
|
||||
principalTable: "ChannelShow",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "OverrideShow",
|
||||
@@ -160,7 +170,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 =>
|
||||
{
|
||||
@@ -170,33 +180,40 @@ 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_ChannelShow_ChannelId_ShowId",
|
||||
table: "ChannelShow",
|
||||
columns: new[] { "ChannelId", "ShowId" });
|
||||
columns: new[] { "ChannelId", "ShowId" }
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ChannelShowHour_ChannelShowId",
|
||||
table: "ChannelShowHour",
|
||||
column: "ChannelShowId");
|
||||
column: "ChannelShowId"
|
||||
);
|
||||
|
||||
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" }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+35
-26
@@ -15,19 +15,22 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
name: "JunctionAfterId",
|
||||
table: "Slots",
|
||||
type: "uuid",
|
||||
nullable: true);
|
||||
nullable: true
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "JunctionBetweenId",
|
||||
table: "Slots",
|
||||
type: "uuid",
|
||||
nullable: true);
|
||||
nullable: true
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DefaultJunctionId",
|
||||
table: "ScheduleTemplates",
|
||||
type: "uuid",
|
||||
nullable: true);
|
||||
nullable: true
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "JunctionTemplates",
|
||||
@@ -35,13 +38,21 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ChannelId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
||||
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
|
||||
Name = table.Column<string>(
|
||||
type: "character varying(128)",
|
||||
maxLength: 128,
|
||||
nullable: false
|
||||
),
|
||||
CreatedAt = table.Column<DateTimeOffset>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: false
|
||||
),
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_JunctionTemplates", x => x.Id);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "JunctionElements",
|
||||
@@ -56,7 +67,7 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
AmountMode = table.Column<int>(type: "integer", nullable: false),
|
||||
AmountValue = table.Column<int>(type: "integer", nullable: false),
|
||||
IsRequired = table.Column<bool>(type: "boolean", nullable: false),
|
||||
ConditionsJson = table.Column<string>(type: "jsonb", nullable: true)
|
||||
ConditionsJson = table.Column<string>(type: "jsonb", nullable: true),
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -66,51 +77,49 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
column: x => x.GroupId,
|
||||
principalTable: "Groups",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
onDelete: ReferentialAction.Restrict
|
||||
);
|
||||
table.ForeignKey(
|
||||
name: "FK_JunctionElements_JunctionTemplates_JunctionTemplateId",
|
||||
column: x => x.JunctionTemplateId,
|
||||
principalTable: "JunctionTemplates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JunctionElements_GroupId",
|
||||
table: "JunctionElements",
|
||||
column: "GroupId");
|
||||
column: "GroupId"
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JunctionElements_JunctionTemplateId_Position",
|
||||
table: "JunctionElements",
|
||||
columns: new[] { "JunctionTemplateId", "Position" });
|
||||
columns: new[] { "JunctionTemplateId", "Position" }
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_JunctionTemplates_ChannelId",
|
||||
table: "JunctionTemplates",
|
||||
column: "ChannelId");
|
||||
column: "ChannelId"
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "JunctionElements");
|
||||
migrationBuilder.DropTable(name: "JunctionElements");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "JunctionTemplates");
|
||||
migrationBuilder.DropTable(name: "JunctionTemplates");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "JunctionAfterId",
|
||||
table: "Slots");
|
||||
migrationBuilder.DropColumn(name: "JunctionAfterId", table: "Slots");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "JunctionBetweenId",
|
||||
table: "Slots");
|
||||
migrationBuilder.DropColumn(name: "JunctionBetweenId", table: "Slots");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DefaultJunctionId",
|
||||
table: "ScheduleTemplates");
|
||||
migrationBuilder.DropColumn(name: "DefaultJunctionId", table: "ScheduleTemplates");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+12
-16
@@ -16,21 +16,13 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
"""UPDATE "Channels" SET "BumperSelection" = 3 WHERE "BumperSelection" = 0;"""
|
||||
);
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BumperEpisodeChangeChance",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "BumperEpisodeChangeChance", table: "Channels");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BumperMinIntervalMinutes",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "BumperMinIntervalMinutes", table: "Channels");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BumperShowChangeChance",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "BumperShowChangeChance", table: "Channels");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "NextBumperIndex",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "NextBumperIndex", table: "Channels");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -41,28 +33,32 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
table: "Channels",
|
||||
type: "double precision",
|
||||
nullable: false,
|
||||
defaultValue: 0.0);
|
||||
defaultValue: 0.0
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "BumperMinIntervalMinutes",
|
||||
table: "Channels",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
defaultValue: 0
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<double>(
|
||||
name: "BumperShowChangeChance",
|
||||
table: "Channels",
|
||||
type: "double precision",
|
||||
nullable: false,
|
||||
defaultValue: 0.0);
|
||||
defaultValue: 0.0
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "NextBumperIndex",
|
||||
table: "Channels",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
defaultValue: 0
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-4
@@ -14,15 +14,14 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
name: "RulesJson",
|
||||
table: "ScheduleTemplates",
|
||||
type: "jsonb",
|
||||
nullable: true);
|
||||
nullable: true
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RulesJson",
|
||||
table: "ScheduleTemplates");
|
||||
migrationBuilder.DropColumn(name: "RulesJson", table: "ScheduleTemplates");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
-20
@@ -16,58 +16,53 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
table: "Channels",
|
||||
type: "double precision",
|
||||
nullable: false,
|
||||
defaultValue: 0.0);
|
||||
defaultValue: 0.0
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "LogoCorner",
|
||||
table: "Channels",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
defaultValue: 0
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "LogoImageId",
|
||||
table: "Channels",
|
||||
type: "uuid",
|
||||
nullable: true);
|
||||
nullable: true
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<double>(
|
||||
name: "LogoOpacity",
|
||||
table: "Channels",
|
||||
type: "double precision",
|
||||
nullable: false,
|
||||
defaultValue: 0.0);
|
||||
defaultValue: 0.0
|
||||
);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "ShowClock",
|
||||
table: "Channels",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
defaultValue: false
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AnalogFilterStrength",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "AnalogFilterStrength", table: "Channels");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LogoCorner",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "LogoCorner", table: "Channels");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LogoImageId",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "LogoImageId", table: "Channels");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LogoOpacity",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "LogoOpacity", table: "Channels");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ShowClock",
|
||||
table: "Channels");
|
||||
migrationBuilder.DropColumn(name: "ShowClock", table: "Channels");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-4
@@ -15,15 +15,14 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
name: "CollectionId",
|
||||
table: "ScheduleEntries",
|
||||
type: "uuid",
|
||||
nullable: true);
|
||||
nullable: true
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CollectionId",
|
||||
table: "ScheduleEntries");
|
||||
migrationBuilder.DropColumn(name: "CollectionId", table: "ScheduleEntries");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,8 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
type: "integer",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer");
|
||||
oldType: "integer"
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -30,7 +31,8 @@ namespace TeleWave.Infrastructure.Migrations
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer",
|
||||
oldNullable: true);
|
||||
oldNullable: true
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
-6
@@ -30,12 +30,14 @@ public class GroupItemConfiguration : IEntityTypeConfiguration<GroupItem>
|
||||
{
|
||||
builder.HasIndex(x => new { x.GroupId, x.Position });
|
||||
// Элемент входит в группу не более одного раза — иначе вес и порядок становятся неоднозначны.
|
||||
builder.HasIndex(x => new
|
||||
{
|
||||
x.GroupId,
|
||||
x.ElementKind,
|
||||
x.ElementId,
|
||||
}).IsUnique();
|
||||
builder
|
||||
.HasIndex(x => new
|
||||
{
|
||||
x.GroupId,
|
||||
x.ElementKind,
|
||||
x.ElementId,
|
||||
})
|
||||
.IsUnique();
|
||||
|
||||
// По этому индексу чистятся позиции при удалении шоу/коллекции: внешнего ключа на
|
||||
// полиморфную ссылку нет, удаление идёт командой.
|
||||
|
||||
@@ -33,7 +33,11 @@ public sealed class SiteSettings(IAppDbContext dbContext) : ISiteSettings
|
||||
dbContext.GetBoolSettingAsync(SettingKeys.ChannelNumbersEnabled, false, cancellationToken);
|
||||
|
||||
public Task SetChannelNumbersEnabledAsync(bool enabled, CancellationToken cancellationToken) =>
|
||||
UpsertAsync(SettingKeys.ChannelNumbersEnabled, enabled ? "true" : "false", cancellationToken);
|
||||
UpsertAsync(
|
||||
SettingKeys.ChannelNumbersEnabled,
|
||||
enabled ? "true" : "false",
|
||||
cancellationToken
|
||||
);
|
||||
|
||||
private async Task UpsertAsync(string key, string value, CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user