Exemplo n.º 1
0
def data(args):
    action = args.action.lower()
    if action == "init":
        init_database_values(s)
    elif action == "truncate":
        truncate_tables(s, db_metadata=db_metadata)
    elif action == "import":
        import_dump(s, args.sql_dumpfile)
Exemplo n.º 2
0
def data(args):
    action = args.action.lower()
    if action == "init":
        init_database_values(s)
    elif action == "truncate":
        truncate_tables(s, db_metadata=db_metadata)
    elif action == "import":
        import_dump(s, args.sql_dumpfile)
Exemplo n.º 3
0
 def check_load_initial_database_values(self, default_admin_password=None):
     s = self.session
     stmt = "SELECT EXISTS (SELECT FROM node)"
     nodes_exist = s.execute(stmt).fetchone()[0]
     if not nodes_exist:
         init_database_values(s, default_admin_password=default_admin_password)
         s.commit()
         return True
     return False
Exemplo n.º 4
0
 def check_load_initial_database_values(self, default_admin_password=None):
     s = self.session
     stmt = "SELECT EXISTS (SELECT FROM node)"
     nodes_exist = s.execute(stmt).fetchone()[0]
     if not nodes_exist:
         init_database_values(s, default_admin_password=default_admin_password)
         s.commit()
         return True
     return False
Exemplo n.º 5
0
def default_data(session):
    """Initial data needed for normal mediaTUM operations
    """
    init_database_values(db.session)