写的啥破玩意,一堆bug

main
RogerWork 3 months ago
parent ffcaac7bc1
commit b25e499da7
  1. 7
      update/utils/git_util.py

@ -115,6 +115,7 @@ class GitUtil:
self.del_func_view()
def del_func_view(self):
print('开始清除function和view')
cmd_list = [
f'DROP FUNCTION IF EXISTS `{self.db_name}`.`GetCostAverage`;',
f'DROP FUNCTION IF EXISTS `{self.db_name}`.`GetGoodsCount`;',
@ -126,13 +127,11 @@ class GitUtil:
f'DROP FUNCTION IF EXISTS `{self.db_name}`.`GetCostMobile`;',
f'DROP VIEW IF EXISTS `{self.db_name}`.`retail_inventory_list`;'
]
print('self.db_config', self.db_config)
_db_conn = pymysql.connect(**self.db_config)
_db_cursor = db_conn.cursor()
_db_cursor.execute()
_db_cursor = _db_conn.cursor()
for cmd in cmd_list:
r = _db_cursor.execute(cmd)
print(cmd, r)
print('清除:' + cmd + '结果:' + str(r))
_db_conn.commit()
_db_cursor.close()
_db_conn.close()

Loading…
Cancel
Save