Skip to content

Commit

Permalink
added missing database name to the db drop and create commands
Browse files Browse the repository at this point in the history
  • Loading branch information
bikegeek committed Jul 23, 2023
1 parent 398535d commit 4cdf718
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions METdbLoad/sql/scripts/db_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def create_database(self):
# Command to create the database, set up permissions, and load the schema.
uname_pass_list = [ '-u', self.user_name, ' -p', self.password, ' -e ']
uname_pass = ''.join(uname_pass_list)
create_str = "'create database'"
create_list = [ "'create database' ", self.db_name]
create_str = ''.join(create_list)
create_cmd = uname_pass + create_str

# Permissions
Expand Down Expand Up @@ -144,7 +145,8 @@ def delete_database(self):
# Command to delete the database
uname_pass_list = ['-u', self.user_name, ' -p' , self.password, ' -e ']
uname_pass = ''.join(uname_pass_list)
drop_str = "'drop database'"
drop_list = ["'drop database' ", self.db_name ]
drop_str = ''.join(drop_list)
drop_cmd = uname_pass + drop_str
logging.debug(f'Drop database command: {drop_cmd}')

Expand Down

0 comments on commit 4cdf718

Please sign in to comment.