Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Execute "moveTableToSchema" if table was succesfully created
  • Loading branch information
rdrg109 committed Aug 18, 2021
commit 7d6fdb95b8093c969e584fe32044030e431595a4
12 changes: 10 additions & 2 deletions load_into_pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,18 @@ def moveTableToSchema(table, schemaName, dbConnectionParam):
handleTable(
table, args.insert_json, args.foreign_keys, args.file, dbConnectionParam
)

# Once "handleTable" has created the table in the "public"
# schema, move the table to the given schema if and only if
# the user specified an schema as an argument for the script
# and the schema name is different than "public".

if args.schema_name != "public":
moveTableToSchema(table, args.schema_name, dbConnectionParam)

else:
six.print_("Cancelled.")
if args.schema_name != "public":
moveTableToSchema(table, args.schema_name, dbConnectionParam)

exit(0)

# load a project
Expand Down