Refactor MongoDB to PostgreSQL data synchronization: remove json2postgres.py, add mongodb2postgres.py for improved schema generation and data insertion
This commit is contained in:
+7
-7
@@ -114,13 +114,13 @@ class settype(object):
|
||||
)
|
||||
currentDir = os.path.dirname(os.path.abspath(__file__))
|
||||
currentDir = os.path.dirname(currentDir)
|
||||
ddl_file_path = f"{currentDir}/db/ddl/recreate_updates_schema.sql"
|
||||
with open(ddl_file_path, "r") as file:
|
||||
sql = file.read()
|
||||
file
|
||||
with engine.connect() as conn:
|
||||
with conn as cursor:
|
||||
cursor.execute(text(sql))
|
||||
# ddl_file_path = f"{currentDir}/db/ddl/recreate_updates_schema.sql"
|
||||
# with open(ddl_file_path, "r") as file:
|
||||
# sql = file.read()
|
||||
# file
|
||||
# with engine.connect() as conn:
|
||||
# with conn as cursor:
|
||||
# cursor.execute(text(sql))
|
||||
updatesBase.prepare(engine, reflect=True, schema="updates")
|
||||
dboBase.prepare(engine, reflect=True, schema="dbo")
|
||||
metadata = sqlalchemy.MetaData(schema="updates")
|
||||
|
||||
Reference in New Issue
Block a user