Ejemplo n.º 1
0
def init_db(testing=False):
    """Initializes the database."""
    clear_db()
    print("Initializing the database")
    db.create_all()
    db.session.commit()
    init_md_code_examples()
    init_md_knowledge_base()
    load_initial_data()
Ejemplo n.º 2
0
def clean_db(testing=False):
    """Clean and Initializes the database.""" 
    log.info("Clean and Initializing the database")
    clear_db()
    db.create_all()
    prerequisits()
    init_md_code_examples()
    init_md_testing_examples()
    init_md_knowledge_base()
    load_initial_data()
    db.session.commit()
Ejemplo n.º 3
0
def init_db(testing=False):
    """Initializes the database."""
    try:
        print("Initializing the database")
        db.create_all()
        db.session.commit()
        init_md_knowledge_base()
        init_md_code_examples()
        load_initial_data()
    except:
        print("Database is already existsing, nothing to do")
Ejemplo n.º 4
0
def init_db(testing=False):
    """Initializes the database.""" 
    try:
        log.info("Initializing the database")
        db.create_all()
        prerequisits()
        init_md_code_examples()
        init_md_testing_examples()
        init_md_knowledge_base()
        load_initial_data()
    except:
        db.session.remove()
        log.info("Database is already existsing, nothing to do")