mirror of
https://github.com/yweber/lodel2.git
synced 2025-11-02 04:20:55 +01:00
Added a first init_db command in scripts/admin
This commit is contained in:
parent
a4dd1950e2
commit
3ba9d9a4fe
1 changed files with 5 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import sys
|
||||
import os, os.path
|
||||
from plugins.mongodb_datasource.migration_handler import MongoDbMigrationHandler
|
||||
|
||||
sys.path.append(os.path.dirname(os.getcwd()+'/..'))
|
||||
from lodel.settings.settings import Settings as settings
|
||||
|
|
@ -22,3 +23,7 @@ def refresh_dyncode(model_file, translator, output_filename):
|
|||
out_fd.write(dyncode)
|
||||
out_fd.close()
|
||||
|
||||
def init_db(conn_args):
|
||||
migration_handler = MongoDbMigrationHandler(conn_args=conn_args)
|
||||
migration_handler._install_collections()
|
||||
migration_handler.database.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue