Skip to content

Commit 794fe05

Browse files
committed
Update 3_load_cdm_vocabulary.py
1 parent d560c9d commit 794fe05

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

3_load_cdm_vocabulary.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def main():
293293
# ---------------------------------------------------------
294294
fname = dir_sql + '4__schema_create.sql'
295295
print('Calling ' + fname + ' ...')
296-
ret = mapping_util.execute_sql_file_parallel(db_conf, fname, False)
296+
ret = mapping_util.execute_sql_file_parallel(db_conf, fname, False, False)
297297
if ret == True:
298298
# ---------------------------------------------------------
299299
# Drop vocabularies tables - Parallel execution of queries in the file - Ask the user for DROP confirmation
@@ -342,19 +342,25 @@ def main():
342342
if ret == True:
343343
print('Finished loading cdm vocabulary.')
344344
# ---------------------------------------------------------
345-
# Create vocabularies PK, indexes, FKs - Parallel execution
345+
# Build PK, indexes - Parallel execution
346346
# ---------------------------------------------------------
347347
if ret == True:
348-
qa = input('Are you sure you want to CREATE PK/IDXs/FKs for all the vocabulary tables (y/n):')
348+
qa = input('Are you sure you want to CREATE PK/IDXs for all the vocabulary tables (y/n):')
349349
while qa.lower() not in ['y', 'n', 'yes', 'no']:
350350
qa = input('I did not understand that. Are you sure you want to CREATE PK/IDXs for all the vocabulary tables (y/n):')
351351
if qa.lower() in ['y', 'yes']:
352-
print('Build PKs, IDXs and FKs ...')
352+
print('Build PKs and IDXs ...')
353353
sql_file_list = sorted(glob.iglob(dir_sql + '3c_cdm_pk_idx_*.sql'))
354354
ret = mapping_util.execute_sql_files_parallel(db_conf, sql_file_list, True)
355355
# ---------------------------------------------------------
356-
# Build FKs
356+
# Build FKs - Parallel execution
357357
# ---------------------------------------------------------
358+
if ret == True:
359+
qa = input('Are you sure you want to CREATE FKs for all the vocabulary tables (y/n):')
360+
while qa.lower() not in ['y', 'n', 'yes', 'no']:
361+
qa = input('I did not understand that. Are you sure you want to CREATE FKs for all the vocabulary tables (y/n):')
362+
if qa.lower() in ['y', 'yes']:
363+
print('Build FKs ...')
358364
if ret == True:
359365
fname = dir_sql + '3d_cdm_fk_voc.sql'
360366
ret = mapping_util.execute_multiple_queries(db_conf, fname, None, None, True, True)

0 commit comments

Comments
 (0)