Skip to content

Commit

Permalink
## 2017年11月24日
Browse files Browse the repository at this point in the history
### 修复主键类型变更没有DROP DELTA的问题
### 修复全量编码不对的问题
### 版本2.6
  • Loading branch information
ruhengChen committed Nov 24, 2017
1 parent 55b1eda commit 65e1b01
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@

## 2017年11月23日
### 修复主键类型变更的问题,YATOPUPDAE少分号的问题,config全量检查默认改为False
### 版本2.5
### 版本2.5

## 2017年11月24日
### 修复主键类型变更没有DROP DELTA的问题
### 修复全量编码不对的问题
### 版本2.6
13 changes: 6 additions & 7 deletions compare_generate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# pylint: disable=C0301
# -*- coding=utf-8 -*-

"""
Expand Down Expand Up @@ -1128,7 +1127,7 @@ def common_deal(self, table, is_add_primary_column_flag, is_del_primary_column_f
self.generate_ap_sql(table, newdate)

self.alter_table_file.write('-- <change from primary key>\n')
self.alter_table_file.write("drop table {delta_tablename};\n".format(delta_tablename=delta_tablename))
self.alter_table_file.write("DROP TABLE {delta_tablename};\n".format(delta_tablename=delta_tablename))
self.alter_table_file.write("rename table {tablename} to {tablenm}_{newdate};\n".format(tablename=table, tablenm=tablenm, newdate=newdate))
self.alter_table_file.write("rename table {his_tablename} to {syscode}_{tablenm}_{newdate};\n".format(his_tablename=his_tablename, syscode=syscode, tablenm=tablenm, newdate=newdate))
self.alter_table_file.write('-- <end>\n')
Expand All @@ -1140,7 +1139,7 @@ def common_deal(self, table, is_add_primary_column_flag, is_del_primary_column_f
self.generate_ddl(table, type='odshis', input_date=newdate)

self.alter_table_file.write('-- <change primary column type>\n')
self.alter_table_file.write("drop table {delta_tablename};\n".format(delta_tablename=delta_tablename))
self.alter_table_file.write("DROP TABLE {delta_tablename};\n".format(delta_tablename=delta_tablename))
self.alter_table_file.write(
"rename table {tablename} to {tablenm}_{newdate};\n".format(tablename=table, tablenm=tablenm,
newdate=newdate))
Expand Down Expand Up @@ -1699,10 +1698,10 @@ def data_fix(self, input_date):

def display_notice(self, input_date):

filelist = glob.glob(config.all_package_path + input_date + '*')
filelist = glob.glob(config.all_package_path + input_date.encode() + '*')

for i in filelist:
with open(i.encode(), 'r') as f:
with open(i, 'r') as f:
data = f.read()

self.read_me_file.write('\n\n'+'*'*100 + '\n' + data + '\n')
Expand Down Expand Up @@ -1865,7 +1864,7 @@ def main(self, input_dict):
'''

self._muti_outStream(u"查找数据修复表\n")
self.data_fix(date_list[1])
self.data_fix(date_list[1].encode())

'''
步骤六: 判断是否为全量
Expand Down Expand Up @@ -1922,7 +1921,7 @@ def main(self, input_dict):
显示公告内容
'''

self.display_notice(input_date)
self.display_notice(date_list[1])

return 0, u'执行成功'

Expand Down
Binary file modified compare_generate.so
Binary file not shown.
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def isLinuxSystem():
return 'Linux' in platform.system()

# 软件版本
software_version=2.5
software_version=2.6

# 数据库配置
edw_dsn = 'edw'
Expand Down

0 comments on commit 65e1b01

Please sign in to comment.