Files
hamkadr/src/JobsMedical.Web/Migrations/20260603210638_IngestionSourcesInSettings.cs
T
soroush.asadi 3c08c1a265
CI/CD / CI · dotnet build (push) Successful in 6m22s
CI/CD / Deploy · hamkadr (push) Failing after 3s
Move ingestion + Telegram/Bale/Divar config to DB-backed admin settings
- AppSetting gains source config: AutoIngestEnabled, IngestIntervalMinutes, Telegram/Bale/Divar enabled+channels/token/queries
- IListingSource.FetchAsync(AppSetting) — sources read config from DB, not IOptions/appsettings; sample source dev-only
- IngestionWorker reads AutoIngest+interval from DB each cycle (toggle at runtime, no redeploy)
- /Admin/Settings gets a 'منابع جمع‌آوری' section; removed Ingestion env/appsettings + compose env vars
- ENV_FILE shrinks to HOST_PORT + POSTGRES_* + ADMIN_PHONE (AI + sources are all in-admin); migration

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 00:44:11 +03:30

118 lines
3.5 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace JobsMedical.Web.Migrations
{
/// <inheritdoc />
public partial class IngestionSourcesInSettings : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "AutoIngestEnabled",
table: "AppSettings",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "BaleBotToken",
table: "AppSettings",
type: "character varying(200)",
maxLength: 200,
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "BaleEnabled",
table: "AppSettings",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "DivarCity",
table: "AppSettings",
type: "character varying(60)",
maxLength: 60,
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "DivarEnabled",
table: "AppSettings",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "DivarQueries",
table: "AppSettings",
type: "character varying(2000)",
maxLength: 2000,
nullable: true);
migrationBuilder.AddColumn<int>(
name: "IngestIntervalMinutes",
table: "AppSettings",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "TelegramChannels",
table: "AppSettings",
type: "character varying(2000)",
maxLength: 2000,
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "TelegramEnabled",
table: "AppSettings",
type: "boolean",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AutoIngestEnabled",
table: "AppSettings");
migrationBuilder.DropColumn(
name: "BaleBotToken",
table: "AppSettings");
migrationBuilder.DropColumn(
name: "BaleEnabled",
table: "AppSettings");
migrationBuilder.DropColumn(
name: "DivarCity",
table: "AppSettings");
migrationBuilder.DropColumn(
name: "DivarEnabled",
table: "AppSettings");
migrationBuilder.DropColumn(
name: "DivarQueries",
table: "AppSettings");
migrationBuilder.DropColumn(
name: "IngestIntervalMinutes",
table: "AppSettings");
migrationBuilder.DropColumn(
name: "TelegramChannels",
table: "AppSettings");
migrationBuilder.DropColumn(
name: "TelegramEnabled",
table: "AppSettings");
}
}
}