diff --git a/tradein-mvp/backend/data/sql/114_scrape_schedules_seed_deactivate_stale_yandex_cian.sql b/tradein-mvp/backend/data/sql/115_scrape_schedules_seed_deactivate_stale_yandex_cian.sql similarity index 97% rename from tradein-mvp/backend/data/sql/114_scrape_schedules_seed_deactivate_stale_yandex_cian.sql rename to tradein-mvp/backend/data/sql/115_scrape_schedules_seed_deactivate_stale_yandex_cian.sql index 9609a819..78820916 100644 --- a/tradein-mvp/backend/data/sql/114_scrape_schedules_seed_deactivate_stale_yandex_cian.sql +++ b/tradein-mvp/backend/data/sql/115_scrape_schedules_seed_deactivate_stale_yandex_cian.sql @@ -1,4 +1,4 @@ --- 114_scrape_schedules_seed_deactivate_stale_yandex_cian.sql +-- 115_scrape_schedules_seed_deactivate_stale_yandex_cian.sql -- Seed scrape_schedules rows for nightly segment-aware stale-listing deactivation -- of yandex and cian vtorichka (#759 generalisation). -- diff --git a/tradein-mvp/backend/tests/test_deactivate_stale_listings.py b/tradein-mvp/backend/tests/test_deactivate_stale_listings.py index e98e8e14..cae3aeb9 100644 --- a/tradein-mvp/backend/tests/test_deactivate_stale_listings.py +++ b/tradein-mvp/backend/tests/test_deactivate_stale_listings.py @@ -14,7 +14,7 @@ from app.services import scheduler from app.tasks import deactivate_stale_avito as task_mod _SQL_DIR = Path(__file__).resolve().parents[1] / "data" / "sql" -_MIGRATION_114 = _SQL_DIR / "114_scrape_schedules_seed_deactivate_stale_yandex_cian.sql" +_MIGRATION_115 = _SQL_DIR / "115_scrape_schedules_seed_deactivate_stale_yandex_cian.sql" _GENERIC_FN_SRC = inspect.getsource(task_mod.deactivate_stale_listings) _COMPAT_FN_SRC = inspect.getsource(task_mod.deactivate_stale_avito_listings) @@ -258,48 +258,48 @@ def test_failure_path_rollback_and_mark_failed(monkeypatch: pytest.MonkeyPatch) assert failed["run_id"] == 8 -def test_migration_114_exists() -> None: - assert _MIGRATION_114.is_file(), f"missing migration: {_MIGRATION_114}" +def test_migration_115_exists() -> None: + assert _MIGRATION_115.is_file(), f"missing migration: {_MIGRATION_115}" -def test_migration_114_seeds_yandex_and_cian() -> None: - sql = _MIGRATION_114.read_text("utf-8") +def test_migration_115_seeds_yandex_and_cian() -> None: + sql = _MIGRATION_115.read_text("utf-8") assert "'deactivate_stale_yandex'" in sql assert "'deactivate_stale_cian'" in sql -def test_migration_114_is_idempotent() -> None: - sql = _MIGRATION_114.read_text("utf-8") +def test_migration_115_is_idempotent() -> None: + sql = _MIGRATION_115.read_text("utf-8") assert "ON CONFLICT (source) DO NOTHING" in sql -def test_migration_114_enabled_true() -> None: - sql = _MIGRATION_114.read_text("utf-8") +def test_migration_115_enabled_true() -> None: + sql = _MIGRATION_115.read_text("utf-8") assert "true" in sql -def test_migration_114_is_transactional() -> None: - sql = _MIGRATION_114.read_text("utf-8") +def test_migration_115_is_transactional() -> None: + sql = _MIGRATION_115.read_text("utf-8") assert "BEGIN;" in sql assert "COMMIT;" in sql -def test_migration_114_window_7_to_8_utc() -> None: - sql = _MIGRATION_114.read_text("utf-8") +def test_migration_115_window_7_to_8_utc() -> None: + sql = _MIGRATION_115.read_text("utf-8") assert re.search(r"\b7\b", sql), "window_start_hour 7 missing" assert re.search(r"\b8\b", sql), "window_end_hour 8 missing" -def test_migration_114_segments_vtorichka_in_default_params() -> None: - sql = _MIGRATION_114.read_text("utf-8") +def test_migration_115_segments_vtorichka_in_default_params() -> None: + sql = _MIGRATION_115.read_text("utf-8") assert "vtorichka" in sql -def test_migration_114_ttl_30_days() -> None: - sql = _MIGRATION_114.read_text("utf-8") +def test_migration_115_ttl_30_days() -> None: + sql = _MIGRATION_115.read_text("utf-8") assert "30" in sql -def test_migration_114_no_psycopg_trap() -> None: - sql = _MIGRATION_114.read_text("utf-8") +def test_migration_115_no_psycopg_trap() -> None: + sql = _MIGRATION_115.read_text("utf-8") assert not re.search(r":\w+::", sql)