fix nested update query in artwork migration

This commit is contained in:
Simon 2026-01-30 17:46:05 +07:00
parent 9badd3b073
commit 5f593ada73
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 5 additions and 4 deletions

View File

@ -376,14 +376,15 @@ class Command(BaseCommand):
"lang": "painless",
},
)
source = f"""
if (ctx._source.containsKey('channel'))
{{ctx._source.channel.remove('{field}');}}
"""
self._run_migration(
index_name="ta_video",
desc=f"fix missing data type for field channel.{field}",
query={"term": {f"channel.{field}": {"value": False}}},
script={
"source": f"ctx._source.remove('channel.{field}')",
"lang": "painless",
},
script={"source": source, "lang": "painless"},
)
def _mig_fix_channel_description(self) -> None: