Commit a95eef6 1 parent 0eef94f commit a95eef6 Copy full SHA for a95eef6
File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 7
7
8
8
from onegov .core .upgrade import upgrade_task , UpgradeContext
9
9
from onegov .search .utils import searchable_sqlalchemy_models
10
+ from onegov .translator_directory .models .translator import Translator
10
11
11
12
12
13
@upgrade_task ('Adds fts index column to all searchable models' )
@@ -30,11 +31,15 @@ def adds_index_data_columns(context: UpgradeContext) -> None:
30
31
31
32
@upgrade_task ('Adds fts data column (json) to all searchable models' )
32
33
def adds_fts_index_data_column (context : UpgradeContext ) -> None :
33
- models = (
34
+ models = [
34
35
model
35
36
for base in context .app .session_manager .bases
36
37
for model in searchable_sqlalchemy_models (base )
37
- )
38
+ ]
39
+
40
+ # I observed that the Translator model may not included in the models list
41
+ models .append (Translator ) if Translator not in models else None
42
+
38
43
for model in models :
39
44
assert hasattr (model , '__tablename__' )
40
45
if not context .has_column (model .__tablename__ , 'fts_idx_data' ):
You can’t perform that action at this time.
0 commit comments