Skip to content

Commit

Permalink
delete database before creating
Browse files Browse the repository at this point in the history
  • Loading branch information
bikegeek committed Jul 23, 2023
1 parent 4cdf718 commit 4e4ef8a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion METdbLoad/sql/scripts/db_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ def create_database(self):
schema_cmd = uname_pass + schema_str
logging.debug(f'Schema command: {schema_cmd}')

# self.delete_database()
try:
self.delete_database()
except subprocess.CalledProcessError:
logging.info("Database doesn't exist. Ignoring this error.")
pass

try:
create_db = subprocess.check_output(['mysql', uname_pass, create_str,
self.db_name])
Expand Down

0 comments on commit 4e4ef8a

Please sign in to comment.