def updatedb(dt, meta=None):
 res = frappe.db.sql(u'select issingle from tabDocType where name=%s', (dt,))
 if (not res):
  raise Exception, (u'Wrong doctype "%s" in updatedb' % dt)
 if (not res[0][0]):
  tab = DbTable(dt, u'tab', meta)
  tab.validate()
  frappe.db.commit()
  tab.sync()
  frappe.db.begin()

def updatedb ( dt , meta = None ) : res = frappe . db . sql ( u'select issingle from tabDocType where name=%s' , ( dt , ) ) if ( not res ) : raise Exception , ( u'Wrong doctype "%s" in updatedb' % dt ) if ( not res [ 0 ] [ 0 ] ) : tab = DbTable ( dt , u'tab' , meta ) tab . validate ( ) frappe . db . commit ( ) tab . sync ( ) frappe . db . begin ( )
updates the locate database cli example: .