1- # SPDX-FileCopyrightText: 2015 Sebastian Wagner, 2023 CERT.at GmbH
1+ # SPDX-FileCopyrightText: 2015-2021 nic.at GmbH, 2022 Sebastian Wagner, 2023 CERT.at GmbH, 2025 Institute for Common Good Technology
22#
33# SPDX-License-Identifier: AGPL-3.0-or-later
44
@@ -133,7 +133,7 @@ def _generate_separated_raws_schema(fields: dict, partition_key: str) -> list:
133133
134134def generate (harmonization_file = HARMONIZATION_CONF_FILE , skip_events = False ,
135135 separate_raws = False , partition_key = None , skip_or_replace = False ,
136- use_jsonb = False ):
136+ no_jsonb = False ):
137137 FIELDS = {}
138138 sql_lines = []
139139
@@ -171,7 +171,7 @@ def generate(harmonization_file=HARMONIZATION_CONF_FILE, skip_events=False,
171171 elif value ['type' ] == 'UUID' :
172172 dbtype = 'UUID'
173173 elif value ['type' ] in ('JSON' , 'JSONDict' ):
174- dbtype = 'jsonb ' if use_jsonb else 'json '
174+ dbtype = 'json ' if no_jsonb else 'jsonb '
175175 else :
176176 raise ValueError ('Unknown type %r.' % value ['type' ])
177177
@@ -213,8 +213,8 @@ def main():
213213 help = "Path to the harmonization file" )
214214 parser .add_argument ("--skip-or-replace" , default = False , action = "store_true" ,
215215 help = "Add IF NOT EXISTS or REPLACE directive to created schemas" )
216- parser .add_argument ("--jsonb" , default = False , action = "store_true" ,
217- help = "Use JSONB type to represent dictionary fields" )
216+ parser .add_argument ("--no- jsonb" , action = "store_true" ,
217+ help = "Do not use JSONB but JSON type to represent dictionary fields" )
218218 args = parser .parse_args ()
219219
220220 OUTPUTFILE = args .outputfile
@@ -232,7 +232,7 @@ def main():
232232 separate_raws = args .separate_raws ,
233233 partition_key = args .partition_key ,
234234 skip_or_replace = args .skip_or_replace ,
235- use_jsonb = args .jsonb ,
235+ no_jsonb = args .no_jsonb ,
236236 )
237237 print ("INFO - Writing %s file" % OUTPUTFILE )
238238 fp .write (psql )
0 commit comments