refactor(translate): remove all deprecated columns from model + DB

Removed 6 legacy columns replaced by Phase 11 multi-language models:
- TranslationJob.target_language → target_languages (JSON)
- TranslationRecord.{llm_translation, user_edit, final_value} → TranslationLanguage
- TerminologyDictionary.{source_language, target_language} → DictionaryEntry per-entry

Affected files: model, schemas, 5 plugins, 4 test files
Alembic migration: aa1b2c3d4e5f (DROP COLUMN IF EXISTS)
Production DB: columns dropped via ALTER TABLE

Tests: 234 passed, 0 failed
This commit is contained in:
2026-05-15 00:06:41 +03:00
parent 6717e2551d
commit 77d55c8e69
12 changed files with 95 additions and 59 deletions

View File

@@ -45,8 +45,6 @@ class TranslationJob(Base):
context_columns = Column(JSON, nullable=True, comment="Context column names included in LLM prompt")
# LLM & processing settings
# @DEPRECATED — use target_languages
target_language = Column(String, nullable=True, comment="Target language code (e.g. en, ru) [DEPRECATED: use target_languages]")
# source_language removed — deprecated, auto-detected per row by LLM; use TranslationLanguage.source_language_detected instead
target_languages = Column(JSON, nullable=True, comment="List of BCP-47 target language codes (multi-language support)")
provider_id = Column(String, nullable=True, comment="LLM provider ID")
@@ -132,13 +130,6 @@ class TranslationRecord(Base):
translation_duration_ms = Column(Integer, nullable=True)
created_at = Column(DateTime, default=lambda: datetime.now(UTC))
# @DEPRECATED — use TranslationLanguage instead
llm_translation = Column(Text, nullable=True, comment="[DEPRECATED: use TranslationLanguage]")
# @DEPRECATED — use TranslationLanguage instead
user_edit = Column(Text, nullable=True, comment="[DEPRECATED: use TranslationLanguage]")
# @DEPRECATED — use TranslationLanguage instead
final_value = Column(Text, nullable=True, comment="[DEPRECATED: use TranslationLanguage]")
languages = relationship("TranslationLanguage", back_populates="record")
__table_args__ = (
@@ -208,10 +199,6 @@ class TerminologyDictionary(Base):
description = Column(Text, nullable=True)
source_dialect = Column(String, nullable=False)
target_dialect = Column(String, nullable=False)
# @DEPRECATED — use per-entry source_language instead, kept for backward compat
source_language = Column(String, nullable=True, comment="[DEPRECATED: use per-entry source_language]")
# @DEPRECATED — use per-entry target_language instead, kept for backward compat
target_language = Column(String, nullable=True, comment="[DEPRECATED: use per-entry target_language]")
is_active = Column(Boolean, default=True)
created_by = Column(String, nullable=True)
created_at = Column(DateTime, default=lambda: datetime.now(UTC))