Skip to content

Commit

Permalink
erdl#119 update init_database to use orm_lonoa
Browse files Browse the repository at this point in the history
instead of orm_egauge
  • Loading branch information
matthew-schultz committed Dec 22, 2019
1 parent 62652ac commit 358393d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions init_database.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import egauge.script.orm_egauge
import orm_lonoa
import getpass #used to get username
import os
import sqlalchemy
Expand Down Expand Up @@ -41,7 +41,7 @@

# create all necessary tables in database
print(__file__ + ': creating tables in database ' + db_name)
egauge.script.orm_egauge.setup()
orm_lonoa.setup()

# connect to the created database to add project_folder_path to Project table
db_url = "postgresql:///" + db_name
Expand All @@ -52,7 +52,7 @@
# check if project_folder_path exists already
results = conn.execute('SELECT 1 FROM project WHERE project_folder_path = \'' + project_folder_path + '\'')
if not results.first():
project_row = egauge.script.orm_egauge.Project(project_folder_path=project_folder_path)
project_row = orm_lonoa.Project(project_folder_path=project_folder_path)
conn.add(project_row)
else:
print(__file__ + ': project_folder_path ' + project_folder_path + ' already exists in project table')
Expand Down

0 comments on commit 358393d

Please sign in to comment.