code: def initdb():
      
  
      print("Syncing up database...")
      cwd_to_sys_path()
      if db and hasattr(db, "Model"):
          db.create_all()
          for m in db.Model.__subclasses__():
              if hasattr(m, "initialize__"):
                  print("Sync up model: %s ..." % m.__name__)
                  getattr(m, "initialize__")()
  
      print("Done")
docs: Sync database Create new tables etc...