Create "gmg convert_mongo_to_sql" command
Finally, to make testing of sql a bit easier, create a bin/gmg command to do the conversion from mongo to sql. It's currently named "convert_mongo_to_sql". The most important option is the gmg -cf option to give a configfile with the appropiate sql_engine definition.
This commit is contained in:
@@ -145,8 +145,8 @@ def convert_media_comments(mk_db):
|
||||
session.close()
|
||||
|
||||
|
||||
def main():
|
||||
global_config, app_config = setup_global_and_app_config("mediagoblin.ini")
|
||||
def run_conversion(config_name):
|
||||
global_config, app_config = setup_global_and_app_config(config_name)
|
||||
|
||||
sql_conn, sql_db = sql_connect(app_config)
|
||||
mk_conn, mk_db = mongo_connect(app_config)
|
||||
@@ -164,4 +164,4 @@ def main():
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
run_conversion("mediagoblin.ini")
|
||||
|
||||
Reference in New Issue
Block a user