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()
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()
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")
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")