mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-03-25 17:41:57 -04:00
recreated db migration
This commit is contained in:
1728
code/backend/Cleanuparr.Persistence/Migrations/Data/20260321145926_AddSeeker.Designer.cs
generated
Normal file
1728
code/backend/Cleanuparr.Persistence/Migrations/Data/20260321145926_AddSeeker.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,291 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Cleanuparr.Persistence.Migrations.Data
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddSeeker : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "on_search_triggered",
|
||||
table: "notification_configs",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "custom_format_score_entries",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
arr_instance_id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
external_item_id = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
episode_id = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
item_type = table.Column<string>(type: "TEXT", nullable: false),
|
||||
title = table.Column<string>(type: "TEXT", nullable: false),
|
||||
file_id = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
current_score = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
cutoff_score = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
quality_profile_name = table.Column<string>(type: "TEXT", nullable: false),
|
||||
last_synced_at = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_custom_format_score_entries", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_custom_format_score_entries_arr_instances_arr_instance_id",
|
||||
column: x => x.arr_instance_id,
|
||||
principalTable: "arr_instances",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "custom_format_score_history",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
arr_instance_id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
external_item_id = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
episode_id = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
item_type = table.Column<string>(type: "TEXT", nullable: false),
|
||||
title = table.Column<string>(type: "TEXT", nullable: false),
|
||||
score = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
cutoff_score = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
recorded_at = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_custom_format_score_history", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_custom_format_score_history_arr_instances_arr_instance_id",
|
||||
column: x => x.arr_instance_id,
|
||||
principalTable: "arr_instances",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "search_queue",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
arr_instance_id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
item_id = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
series_id = table.Column<long>(type: "INTEGER", nullable: true),
|
||||
search_type = table.Column<string>(type: "TEXT", nullable: true),
|
||||
title = table.Column<string>(type: "TEXT", nullable: false),
|
||||
created_at = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_search_queue", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_search_queue_arr_instances_arr_instance_id",
|
||||
column: x => x.arr_instance_id,
|
||||
principalTable: "arr_instances",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "seeker_command_trackers",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
arr_instance_id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
command_id = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
event_id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
external_item_id = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
item_title = table.Column<string>(type: "TEXT", nullable: false),
|
||||
item_type = table.Column<string>(type: "TEXT", nullable: false),
|
||||
season_number = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
created_at = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
status = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_seeker_command_trackers", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_seeker_command_trackers_arr_instances_arr_instance_id",
|
||||
column: x => x.arr_instance_id,
|
||||
principalTable: "arr_instances",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "seeker_configs",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
search_enabled = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
search_interval = table.Column<ushort>(type: "INTEGER", nullable: false),
|
||||
proactive_search_enabled = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
selection_strategy = table.Column<string>(type: "TEXT", nullable: false),
|
||||
monitored_only = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
use_cutoff = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
use_custom_format_score = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
use_round_robin = table.Column<bool>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_seeker_configs", x => x.id);
|
||||
});
|
||||
|
||||
// Migrate old data
|
||||
migrationBuilder.InsertData(
|
||||
table: "seeker_configs",
|
||||
columns: new[] { "id", "search_enabled", "search_interval", "proactive_search_enabled", "selection_strategy", "monitored_only", "use_cutoff", "use_custom_format_score", "use_round_robin" },
|
||||
values: new object[] { Guid.NewGuid(), true, 10, false, "balancedweighted", true, true, true, true });
|
||||
|
||||
migrationBuilder.Sql(@"
|
||||
UPDATE seeker_configs SET search_enabled = (
|
||||
SELECT COALESCE(g.search_enabled, 1) FROM general_configs g LIMIT 1
|
||||
)");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "seeker_history",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
arr_instance_id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
external_item_id = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
item_type = table.Column<string>(type: "TEXT", nullable: false),
|
||||
season_number = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
run_id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
last_searched_at = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
item_title = table.Column<string>(type: "TEXT", nullable: false),
|
||||
search_count = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_seeker_history", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_seeker_history_arr_instances_arr_instance_id",
|
||||
column: x => x.arr_instance_id,
|
||||
principalTable: "arr_instances",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "seeker_instance_configs",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
arr_instance_id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
enabled = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
skip_tags = table.Column<string>(type: "TEXT", nullable: false),
|
||||
last_processed_at = table.Column<DateTime>(type: "TEXT", nullable: true),
|
||||
current_run_id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
total_eligible_items = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
active_download_limit = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_seeker_instance_configs", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_seeker_instance_configs_arr_instances_arr_instance_id",
|
||||
column: x => x.arr_instance_id,
|
||||
principalTable: "arr_instances",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "search_delay",
|
||||
table: "general_configs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "search_enabled",
|
||||
table: "general_configs");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_custom_format_score_entries_arr_instance_id_external_item_id_episode_id",
|
||||
table: "custom_format_score_entries",
|
||||
columns: new[] { "arr_instance_id", "external_item_id", "episode_id" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_custom_format_score_history_arr_instance_id_external_item_id_episode_id",
|
||||
table: "custom_format_score_history",
|
||||
columns: new[] { "arr_instance_id", "external_item_id", "episode_id" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_custom_format_score_history_recorded_at",
|
||||
table: "custom_format_score_history",
|
||||
column: "recorded_at");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_search_queue_arr_instance_id",
|
||||
table: "search_queue",
|
||||
column: "arr_instance_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_seeker_command_trackers_arr_instance_id",
|
||||
table: "seeker_command_trackers",
|
||||
column: "arr_instance_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_seeker_history_arr_instance_id_external_item_id_item_type_season_number_run_id",
|
||||
table: "seeker_history",
|
||||
columns: new[] { "arr_instance_id", "external_item_id", "item_type", "season_number", "run_id" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_seeker_instance_configs_arr_instance_id",
|
||||
table: "seeker_instance_configs",
|
||||
column: "arr_instance_id",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "custom_format_score_entries");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "custom_format_score_history");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "search_queue");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "seeker_command_trackers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "seeker_configs");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "seeker_history");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "seeker_instance_configs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "on_search_triggered",
|
||||
table: "notification_configs");
|
||||
|
||||
migrationBuilder.AddColumn<ushort>(
|
||||
name: "search_delay",
|
||||
table: "general_configs",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: (ushort)0);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "search_enabled",
|
||||
table: "general_configs",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -303,14 +303,6 @@ namespace Cleanuparr.Persistence.Migrations.Data
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("ignored_downloads");
|
||||
|
||||
b.Property<ushort>("SearchDelay")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("search_delay");
|
||||
|
||||
b.Property<bool>("SearchEnabled")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("search_enabled");
|
||||
|
||||
b.Property<bool>("StatusCheckEnabled")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("status_check_enabled");
|
||||
@@ -703,6 +695,10 @@ namespace Cleanuparr.Persistence.Migrations.Data
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("on_queue_item_deleted");
|
||||
|
||||
b.Property<bool>("OnSearchTriggered")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("on_search_triggered");
|
||||
|
||||
b.Property<bool>("OnSlowStrike")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("on_slow_strike");
|
||||
@@ -1090,6 +1086,98 @@ namespace Cleanuparr.Persistence.Migrations.Data
|
||||
b.ToTable("stall_rules", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.Configuration.Seeker.SeekerConfig", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<bool>("MonitoredOnly")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("monitored_only");
|
||||
|
||||
b.Property<bool>("ProactiveSearchEnabled")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("proactive_search_enabled");
|
||||
|
||||
b.Property<bool>("SearchEnabled")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("search_enabled");
|
||||
|
||||
b.Property<ushort>("SearchInterval")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("search_interval");
|
||||
|
||||
b.Property<string>("SelectionStrategy")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("selection_strategy");
|
||||
|
||||
b.Property<bool>("UseCustomFormatScore")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("use_custom_format_score");
|
||||
|
||||
b.Property<bool>("UseCutoff")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("use_cutoff");
|
||||
|
||||
b.Property<bool>("UseRoundRobin")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("use_round_robin");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_seeker_configs");
|
||||
|
||||
b.ToTable("seeker_configs", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.Configuration.Seeker.SeekerInstanceConfig", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<int>("ActiveDownloadLimit")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("active_download_limit");
|
||||
|
||||
b.Property<Guid>("ArrInstanceId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("arr_instance_id");
|
||||
|
||||
b.Property<Guid>("CurrentRunId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("current_run_id");
|
||||
|
||||
b.Property<bool>("Enabled")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("enabled");
|
||||
|
||||
b.Property<DateTime?>("LastProcessedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_processed_at");
|
||||
|
||||
b.PrimitiveCollection<string>("SkipTags")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("skip_tags");
|
||||
|
||||
b.Property<int>("TotalEligibleItems")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("total_eligible_items");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_seeker_instance_configs");
|
||||
|
||||
b.HasIndex("ArrInstanceId")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_seeker_instance_configs_arr_instance_id");
|
||||
|
||||
b.ToTable("seeker_instance_configs", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.BlacklistSyncHistory", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -1122,6 +1210,266 @@ namespace Cleanuparr.Persistence.Migrations.Data
|
||||
b.ToTable("blacklist_sync_history", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.CustomFormatScoreEntry", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<Guid>("ArrInstanceId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("arr_instance_id");
|
||||
|
||||
b.Property<int>("CurrentScore")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("current_score");
|
||||
|
||||
b.Property<int>("CutoffScore")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("cutoff_score");
|
||||
|
||||
b.Property<long>("EpisodeId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("episode_id");
|
||||
|
||||
b.Property<long>("ExternalItemId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("external_item_id");
|
||||
|
||||
b.Property<long>("FileId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("file_id");
|
||||
|
||||
b.Property<string>("ItemType")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("item_type");
|
||||
|
||||
b.Property<DateTime>("LastSyncedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_synced_at");
|
||||
|
||||
b.Property<string>("QualityProfileName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("quality_profile_name");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_custom_format_score_entries");
|
||||
|
||||
b.HasIndex("ArrInstanceId", "ExternalItemId", "EpisodeId")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_custom_format_score_entries_arr_instance_id_external_item_id_episode_id");
|
||||
|
||||
b.ToTable("custom_format_score_entries", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.CustomFormatScoreHistory", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<Guid>("ArrInstanceId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("arr_instance_id");
|
||||
|
||||
b.Property<int>("CutoffScore")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("cutoff_score");
|
||||
|
||||
b.Property<long>("EpisodeId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("episode_id");
|
||||
|
||||
b.Property<long>("ExternalItemId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("external_item_id");
|
||||
|
||||
b.Property<string>("ItemType")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("item_type");
|
||||
|
||||
b.Property<DateTime>("RecordedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("recorded_at");
|
||||
|
||||
b.Property<int>("Score")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("score");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_custom_format_score_history");
|
||||
|
||||
b.HasIndex("RecordedAt")
|
||||
.HasDatabaseName("ix_custom_format_score_history_recorded_at");
|
||||
|
||||
b.HasIndex("ArrInstanceId", "ExternalItemId", "EpisodeId")
|
||||
.HasDatabaseName("ix_custom_format_score_history_arr_instance_id_external_item_id_episode_id");
|
||||
|
||||
b.ToTable("custom_format_score_history", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.SearchQueueItem", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<Guid>("ArrInstanceId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("arr_instance_id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<long>("ItemId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("item_id");
|
||||
|
||||
b.Property<string>("SearchType")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("search_type");
|
||||
|
||||
b.Property<long?>("SeriesId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("series_id");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_search_queue");
|
||||
|
||||
b.HasIndex("ArrInstanceId")
|
||||
.HasDatabaseName("ix_search_queue_arr_instance_id");
|
||||
|
||||
b.ToTable("search_queue", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.SeekerCommandTracker", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<Guid>("ArrInstanceId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("arr_instance_id");
|
||||
|
||||
b.Property<long>("CommandId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("command_id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<Guid>("EventId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("event_id");
|
||||
|
||||
b.Property<long>("ExternalItemId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("external_item_id");
|
||||
|
||||
b.Property<string>("ItemTitle")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("item_title");
|
||||
|
||||
b.Property<string>("ItemType")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("item_type");
|
||||
|
||||
b.Property<int>("SeasonNumber")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("season_number");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("status");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_seeker_command_trackers");
|
||||
|
||||
b.HasIndex("ArrInstanceId")
|
||||
.HasDatabaseName("ix_seeker_command_trackers_arr_instance_id");
|
||||
|
||||
b.ToTable("seeker_command_trackers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.SeekerHistory", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<Guid>("ArrInstanceId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("arr_instance_id");
|
||||
|
||||
b.Property<long>("ExternalItemId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("external_item_id");
|
||||
|
||||
b.Property<string>("ItemTitle")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("item_title");
|
||||
|
||||
b.Property<string>("ItemType")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("item_type");
|
||||
|
||||
b.Property<DateTime>("LastSearchedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last_searched_at");
|
||||
|
||||
b.Property<Guid>("RunId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("run_id");
|
||||
|
||||
b.Property<int>("SearchCount")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("search_count");
|
||||
|
||||
b.Property<int>("SeasonNumber")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("season_number");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_seeker_history");
|
||||
|
||||
b.HasIndex("ArrInstanceId", "ExternalItemId", "ItemType", "SeasonNumber", "RunId")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_seeker_history_arr_instance_id_external_item_id_item_type_season_number_run_id");
|
||||
|
||||
b.ToTable("seeker_history", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.Configuration.Arr.ArrInstance", b =>
|
||||
{
|
||||
b.HasOne("Cleanuparr.Persistence.Models.Configuration.Arr.ArrConfig", "ArrConfig")
|
||||
@@ -1254,6 +1602,18 @@ namespace Cleanuparr.Persistence.Migrations.Data
|
||||
b.Navigation("QueueCleanerConfig");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.Configuration.Seeker.SeekerInstanceConfig", b =>
|
||||
{
|
||||
b.HasOne("Cleanuparr.Persistence.Models.Configuration.Arr.ArrInstance", "ArrInstance")
|
||||
.WithMany()
|
||||
.HasForeignKey("ArrInstanceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_seeker_instance_configs_arr_instances_arr_instance_id");
|
||||
|
||||
b.Navigation("ArrInstance");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.BlacklistSyncHistory", b =>
|
||||
{
|
||||
b.HasOne("Cleanuparr.Persistence.Models.Configuration.DownloadClientConfig", "DownloadClient")
|
||||
@@ -1266,6 +1626,66 @@ namespace Cleanuparr.Persistence.Migrations.Data
|
||||
b.Navigation("DownloadClient");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.CustomFormatScoreEntry", b =>
|
||||
{
|
||||
b.HasOne("Cleanuparr.Persistence.Models.Configuration.Arr.ArrInstance", "ArrInstance")
|
||||
.WithMany()
|
||||
.HasForeignKey("ArrInstanceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_custom_format_score_entries_arr_instances_arr_instance_id");
|
||||
|
||||
b.Navigation("ArrInstance");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.CustomFormatScoreHistory", b =>
|
||||
{
|
||||
b.HasOne("Cleanuparr.Persistence.Models.Configuration.Arr.ArrInstance", "ArrInstance")
|
||||
.WithMany()
|
||||
.HasForeignKey("ArrInstanceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_custom_format_score_history_arr_instances_arr_instance_id");
|
||||
|
||||
b.Navigation("ArrInstance");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.SearchQueueItem", b =>
|
||||
{
|
||||
b.HasOne("Cleanuparr.Persistence.Models.Configuration.Arr.ArrInstance", "ArrInstance")
|
||||
.WithMany()
|
||||
.HasForeignKey("ArrInstanceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_search_queue_arr_instances_arr_instance_id");
|
||||
|
||||
b.Navigation("ArrInstance");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.SeekerCommandTracker", b =>
|
||||
{
|
||||
b.HasOne("Cleanuparr.Persistence.Models.Configuration.Arr.ArrInstance", "ArrInstance")
|
||||
.WithMany()
|
||||
.HasForeignKey("ArrInstanceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_seeker_command_trackers_arr_instances_arr_instance_id");
|
||||
|
||||
b.Navigation("ArrInstance");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.SeekerHistory", b =>
|
||||
{
|
||||
b.HasOne("Cleanuparr.Persistence.Models.Configuration.Arr.ArrInstance", "ArrInstance")
|
||||
.WithMany()
|
||||
.HasForeignKey("ArrInstanceId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_seeker_history_arr_instances_arr_instance_id");
|
||||
|
||||
b.Navigation("ArrInstance");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.Configuration.Arr.ArrConfig", b =>
|
||||
{
|
||||
b.Navigation("Instances");
|
||||
|
||||
405
code/backend/Cleanuparr.Persistence/Migrations/Events/20260321145918_AddSeeker.Designer.cs
generated
Normal file
405
code/backend/Cleanuparr.Persistence/Migrations/Events/20260321145918_AddSeeker.Designer.cs
generated
Normal file
@@ -0,0 +1,405 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Cleanuparr.Persistence;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Cleanuparr.Persistence.Migrations.Events
|
||||
{
|
||||
[DbContext(typeof(EventsContext))]
|
||||
[Migration("20260321145918_AddSeeker")]
|
||||
partial class AddSeeker
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "10.0.1");
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.Events.AppEvent", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime?>("CompletedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("completed_at");
|
||||
|
||||
b.Property<Guid?>("CycleRunId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("cycle_run_id");
|
||||
|
||||
b.Property<string>("Data")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("data");
|
||||
|
||||
b.Property<string>("DownloadClientName")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("download_client_name");
|
||||
|
||||
b.Property<string>("DownloadClientType")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("download_client_type");
|
||||
|
||||
b.Property<string>("EventType")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("event_type");
|
||||
|
||||
b.Property<string>("InstanceType")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("instance_type");
|
||||
|
||||
b.Property<string>("InstanceUrl")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("instance_url");
|
||||
|
||||
b.Property<bool>("IsDryRun")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("is_dry_run");
|
||||
|
||||
b.Property<Guid?>("JobRunId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("job_run_id");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("message");
|
||||
|
||||
b.Property<string>("SearchStatus")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("search_status");
|
||||
|
||||
b.Property<string>("Severity")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("severity");
|
||||
|
||||
b.Property<Guid?>("StrikeId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("strike_id");
|
||||
|
||||
b.Property<DateTime>("Timestamp")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("timestamp");
|
||||
|
||||
b.Property<Guid?>("TrackingId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("tracking_id");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_events");
|
||||
|
||||
b.HasIndex("CycleRunId")
|
||||
.HasDatabaseName("ix_events_cycle_run_id");
|
||||
|
||||
b.HasIndex("DownloadClientType")
|
||||
.HasDatabaseName("ix_events_download_client_type");
|
||||
|
||||
b.HasIndex("EventType")
|
||||
.HasDatabaseName("ix_events_event_type");
|
||||
|
||||
b.HasIndex("InstanceType")
|
||||
.HasDatabaseName("ix_events_instance_type");
|
||||
|
||||
b.HasIndex("JobRunId")
|
||||
.HasDatabaseName("ix_events_job_run_id");
|
||||
|
||||
b.HasIndex("Message")
|
||||
.HasDatabaseName("ix_events_message");
|
||||
|
||||
b.HasIndex("Severity")
|
||||
.HasDatabaseName("ix_events_severity");
|
||||
|
||||
b.HasIndex("StrikeId")
|
||||
.HasDatabaseName("ix_events_strike_id");
|
||||
|
||||
b.HasIndex("Timestamp")
|
||||
.IsDescending()
|
||||
.HasDatabaseName("ix_events_timestamp");
|
||||
|
||||
b.ToTable("events", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.Events.ManualEvent", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("Data")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("data");
|
||||
|
||||
b.Property<string>("DownloadClientName")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("download_client_name");
|
||||
|
||||
b.Property<string>("DownloadClientType")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("download_client_type");
|
||||
|
||||
b.Property<string>("InstanceType")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("instance_type");
|
||||
|
||||
b.Property<string>("InstanceUrl")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("instance_url");
|
||||
|
||||
b.Property<bool>("IsDryRun")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("is_dry_run");
|
||||
|
||||
b.Property<bool>("IsResolved")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("is_resolved");
|
||||
|
||||
b.Property<Guid?>("JobRunId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("job_run_id");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("message");
|
||||
|
||||
b.Property<string>("Severity")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("severity");
|
||||
|
||||
b.Property<DateTime>("Timestamp")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("timestamp");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_manual_events");
|
||||
|
||||
b.HasIndex("InstanceType")
|
||||
.HasDatabaseName("ix_manual_events_instance_type");
|
||||
|
||||
b.HasIndex("IsResolved")
|
||||
.HasDatabaseName("ix_manual_events_is_resolved");
|
||||
|
||||
b.HasIndex("JobRunId")
|
||||
.HasDatabaseName("ix_manual_events_job_run_id");
|
||||
|
||||
b.HasIndex("Message")
|
||||
.HasDatabaseName("ix_manual_events_message");
|
||||
|
||||
b.HasIndex("Severity")
|
||||
.HasDatabaseName("ix_manual_events_severity");
|
||||
|
||||
b.HasIndex("Timestamp")
|
||||
.IsDescending()
|
||||
.HasDatabaseName("ix_manual_events_timestamp");
|
||||
|
||||
b.ToTable("manual_events", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.DownloadItem", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("DownloadId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("download_id");
|
||||
|
||||
b.Property<bool>("IsMarkedForRemoval")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("is_marked_for_removal");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("is_removed");
|
||||
|
||||
b.Property<bool>("IsReturning")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("is_returning");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("title");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_download_items");
|
||||
|
||||
b.HasIndex("DownloadId")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_download_items_download_id");
|
||||
|
||||
b.ToTable("download_items", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.JobRun", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime?>("CompletedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("completed_at");
|
||||
|
||||
b.Property<DateTime>("StartedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("started_at");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("status");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("type");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_job_runs");
|
||||
|
||||
b.HasIndex("StartedAt")
|
||||
.IsDescending()
|
||||
.HasDatabaseName("ix_job_runs_started_at");
|
||||
|
||||
b.HasIndex("Type")
|
||||
.HasDatabaseName("ix_job_runs_type");
|
||||
|
||||
b.ToTable("job_runs", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.Strike", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<Guid>("DownloadItemId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("download_item_id");
|
||||
|
||||
b.Property<bool>("IsDryRun")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("is_dry_run");
|
||||
|
||||
b.Property<Guid>("JobRunId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("job_run_id");
|
||||
|
||||
b.Property<long?>("LastDownloadedBytes")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("last_downloaded_bytes");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("type");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_strikes");
|
||||
|
||||
b.HasIndex("CreatedAt")
|
||||
.HasDatabaseName("ix_strikes_created_at");
|
||||
|
||||
b.HasIndex("JobRunId")
|
||||
.HasDatabaseName("ix_strikes_job_run_id");
|
||||
|
||||
b.HasIndex("DownloadItemId", "Type")
|
||||
.HasDatabaseName("ix_strikes_download_item_id_type");
|
||||
|
||||
b.ToTable("strikes", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.Events.AppEvent", b =>
|
||||
{
|
||||
b.HasOne("Cleanuparr.Persistence.Models.State.JobRun", "JobRun")
|
||||
.WithMany("Events")
|
||||
.HasForeignKey("JobRunId")
|
||||
.HasConstraintName("fk_events_job_runs_job_run_id");
|
||||
|
||||
b.HasOne("Cleanuparr.Persistence.Models.State.Strike", "Strike")
|
||||
.WithMany()
|
||||
.HasForeignKey("StrikeId")
|
||||
.OnDelete(DeleteBehavior.SetNull)
|
||||
.HasConstraintName("fk_events_strikes_strike_id");
|
||||
|
||||
b.Navigation("JobRun");
|
||||
|
||||
b.Navigation("Strike");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.Events.ManualEvent", b =>
|
||||
{
|
||||
b.HasOne("Cleanuparr.Persistence.Models.State.JobRun", "JobRun")
|
||||
.WithMany("ManualEvents")
|
||||
.HasForeignKey("JobRunId")
|
||||
.HasConstraintName("fk_manual_events_job_runs_job_run_id");
|
||||
|
||||
b.Navigation("JobRun");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.Strike", b =>
|
||||
{
|
||||
b.HasOne("Cleanuparr.Persistence.Models.State.DownloadItem", "DownloadItem")
|
||||
.WithMany("Strikes")
|
||||
.HasForeignKey("DownloadItemId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_strikes_download_items_download_item_id");
|
||||
|
||||
b.HasOne("Cleanuparr.Persistence.Models.State.JobRun", "JobRun")
|
||||
.WithMany("Strikes")
|
||||
.HasForeignKey("JobRunId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_strikes_job_runs_job_run_id");
|
||||
|
||||
b.Navigation("DownloadItem");
|
||||
|
||||
b.Navigation("JobRun");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.DownloadItem", b =>
|
||||
{
|
||||
b.Navigation("Strikes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cleanuparr.Persistence.Models.State.JobRun", b =>
|
||||
{
|
||||
b.Navigation("Events");
|
||||
|
||||
b.Navigation("ManualEvents");
|
||||
|
||||
b.Navigation("Strikes");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Cleanuparr.Persistence.Migrations.Events
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddSeeker : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "completed_at",
|
||||
table: "events",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "cycle_run_id",
|
||||
table: "events",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "search_status",
|
||||
table: "events",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_events_cycle_run_id",
|
||||
table: "events",
|
||||
column: "cycle_run_id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "ix_events_cycle_run_id",
|
||||
table: "events");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "completed_at",
|
||||
table: "events");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "cycle_run_id",
|
||||
table: "events");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "search_status",
|
||||
table: "events");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,14 @@ namespace Cleanuparr.Persistence.Migrations.Events
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime?>("CompletedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("completed_at");
|
||||
|
||||
b.Property<Guid?>("CycleRunId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("cycle_run_id");
|
||||
|
||||
b.Property<string>("Data")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("data");
|
||||
@@ -65,6 +73,10 @@ namespace Cleanuparr.Persistence.Migrations.Events
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("message");
|
||||
|
||||
b.Property<string>("SearchStatus")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("search_status");
|
||||
|
||||
b.Property<string>("Severity")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
@@ -85,6 +97,9 @@ namespace Cleanuparr.Persistence.Migrations.Events
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_events");
|
||||
|
||||
b.HasIndex("CycleRunId")
|
||||
.HasDatabaseName("ix_events_cycle_run_id");
|
||||
|
||||
b.HasIndex("DownloadClientType")
|
||||
.HasDatabaseName("ix_events_download_client_type");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user