1. 数据接口升级
tw_usr_info_d 数据程序开发
exp_tw_usr_info_d_hwr 数据程序开发
完成判断条件 执行后输出接口 路径 文件名无误 内容无误
2. 程序代码升级
sudo vim models.py
sudo vim serializers.py
sudo vim views.py
sudo vim urls.py
sudo python3 manage.py makemigrations
sudo python3 manage.py migrate
完成判断条件 迁移指令正确返回
3. 数据模型重建
sudo python3 manage.py makemigrations
sudo python3 manage.py migrate
完成判断条件 查看数据库表结构和迁移记录
4. 同步定时任务更新
编辑定时脚本和数据库维护脚本更新
— usr_yx.sh
#!/bin/bash
#ftp
ftp -i -n <<EOFFTP
open IP
user usr pasd
bin
lcd /dir
prompt
get f1.txt
get f2.txt
bye
EOFFTP
ls -l
mysql -uroot -p11 -e “source /home/ddmt/data/temp.sql”
定时任务上线
# m h dom mon dow command
0 9 * * * cd /home/ddmt/data; ./usr_yx.sh & >> /dev/null;
数据库维护脚本
---temp.sql
```sql
use ddapi_db;
SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE ddmtapi_usr_inf DISABLE KEYS;
truncate table ddmtapi_usr_inf;
commit;
load data local infile '/f1/f1.txt' into table ddmtapi_usr_inf
CHARACTER SET utf8
FIELDS TERMINATED BY '|'
LINES TERMINATED BY '\n'
;
ALTER TABLE ddmtapi_usr_inf ENABLE KEYS;
commit;
SET FOREIGN_KEY_CHECKS=1;
REPAIR TABLE ddmtapi_usr_inf QUICK;
commit;
SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE ddmtapi_usr_info DISABLE KEYS;
truncate table ddmtapi_usr_info;
commit;
load data local infile '/f2/f2.txt' into table ddmtapi_usr_info
CHARACTER SET utf8
FIELDS TERMINATED BY '|'
LINES TERMINATED BY '\n'
;
ALTER TABLE ddmtapi_usr_info ENABLE KEYS;
commit;
SET FOREIGN_KEY_CHECKS=1;
REPAIR TABLE ddmtapi_usr_info QUICK;
commit;
**完成判断条件 手动执行 usr_yx.sh OK .**