Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ WIP ] 把一些关联字段从name改成ID 包括权限,用户, 实例,查询日志等的互相关联 #71

Merged
merged 8 commits into from
Mar 21, 2019

Conversation

LeoQuote
Copy link
Collaborator

@LeoQuote LeoQuote commented Mar 17, 2019

一期计划:

  • 修改查询权限部分的代码, 把instance_name改为id
  • 修改工单权限部分的代码,把instance_name改为id

二期计划:

  • 用户
  • 查询日志
  • 脱敏字段
  • RDS配置信息

#67

@LeoQuote
Copy link
Collaborator Author

LeoQuote commented Mar 19, 2019

更改过程中发现, 用户的表权限, 是否有权限, 授予权限, 剥夺权限, 调整权限, 都是通过filter获取权限对象, 然后修改对象实现的。
这些功能在各处都是分开实现的, 有大量的重复代码,准备在这次修改过程中将查询权限相关的所有代码集合到上面所说的四个方法, 放在用户对象中进行实现。 如果位置有问题的话, 后期可以再进行修改。

如果集合到用户方法中, 如何做到批量添加/高效率添加?

@hhyo
Copy link
Owner

hhyo commented Mar 19, 2019

作为用户的属性?还是增加四个方法,批量更新和插入可以参考现在的实现吧。

@LeoQuote
Copy link
Collaborator Author

累了, 我不动了, 直接改原代码, 加字段就成。。。后期再用多对多的关联起来吧

@hhyo
Copy link
Owner

hhyo commented Mar 20, 2019

🌚

@codecov
Copy link

codecov bot commented Mar 20, 2019

Codecov Report

Merging #71 into master will increase coverage by 1.73%.
The diff coverage is 71.79%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
+ Coverage    56.6%   58.34%   +1.73%     
==========================================
  Files          59       59              
  Lines        5492     5553      +61     
==========================================
+ Hits         3109     3240     +131     
+ Misses       2383     2313      -70
Impacted Files Coverage Δ
sql/notify.py 12.5% <ø> (ø) ⬆️
sql/aliyun_rds.py 10.98% <0%> (ø) ⬆️
sql/utils/sql_review.py 37.7% <0%> (ø) ⬆️
sql/db_diagnostic.py 13.63% <0%> (ø) ⬆️
sql/slowlog.py 21.53% <0%> (ø) ⬆️
sql/engines/tests.py 100% <100%> (ø) ⬆️
sql/models.py 95.99% <100%> (ø) ⬆️
sql/sql_workflow.py 53.77% <100%> (+19.67%) ⬆️
common/tests.py 100% <100%> (ø) ⬆️
sql/tests.py 100% <100%> (ø) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9548c59...099ff72. Read the comment docs.

@LeoQuote LeoQuote force-pushed the feature/replace_name_with_id branch from a022b92 to 9f42941 Compare March 20, 2019 08:35
@LeoQuote LeoQuote requested a review from hhyo March 20, 2019 11:58
Copy link
Owner

@hhyo hhyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 原来工单要改的这么少,😳
  • 脱敏字段貌似也是需要改外键的,一样改实例名就失效
  • name名称的话,我的建议是不改,name是mysql关键字,要缩短或许可以叫ins_name?

@LeoQuote LeoQuote added this to In progress in v1.4.5 via automation Mar 21, 2019
@hhyo hhyo force-pushed the feature/replace_name_with_id branch from 480d83b to 0be6581 Compare March 21, 2019 06:09
@hhyo hhyo merged commit 2b8890c into master Mar 21, 2019
v1.4.5 automation moved this from In progress to Done Mar 21, 2019
@hhyo hhyo deleted the feature/replace_name_with_id branch March 30, 2019 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v1.4.5
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants