Adds AppSettings.UsageGateFiveHourPct/UsageGateSevenDayPct (defaults 80/90, clamped 0..100 in UpdateAsync) and a nullable TaskRunEntity.Model column, laying the data foundation for the usage monitor. No worker/UI changes.
58 lines
1.7 KiB
C#
58 lines
1.7 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace ClaudeDo.Data.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddUsageGateAndRunModel : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "model",
|
|
table: "task_runs",
|
|
type: "TEXT",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "usage_gate_five_hour_pct",
|
|
table: "app_settings",
|
|
type: "INTEGER",
|
|
nullable: false,
|
|
defaultValue: 80);
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "usage_gate_seven_day_pct",
|
|
table: "app_settings",
|
|
type: "INTEGER",
|
|
nullable: false,
|
|
defaultValue: 90);
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "app_settings",
|
|
keyColumn: "id",
|
|
keyValue: 1,
|
|
columns: new[] { "usage_gate_five_hour_pct", "usage_gate_seven_day_pct" },
|
|
values: new object[] { 80, 90 });
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "model",
|
|
table: "task_runs");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "usage_gate_five_hour_pct",
|
|
table: "app_settings");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "usage_gate_seven_day_pct",
|
|
table: "app_settings");
|
|
}
|
|
}
|
|
}
|