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

数据库查询字段不区分大小写,脱敏失败问题 #2332

Closed
wants to merge 18 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
case_sensitive 添加默认值
  • Loading branch information
woshiyanghai committed Oct 13, 2023
commit a899ba61ed8580b28d89fd9727441b5fdf8910f9
2 changes: 1 addition & 1 deletion sql/models.py
Original file line number Diff line number Diff line change
@@ -572,7 +572,7 @@ class DataMaskingColumns(models.Model):
table_name = models.CharField("字段所在表名", max_length=64)
column_name = models.CharField("字段名", max_length=64)
case_sensitive = models.BooleanField(
"字段区分大小写", choices=((False, "不区分"), (True, "区分"))
"字段区分大小写", default=False,choices=((False, "不区分"), (True, "区分"))
)
column_comment = models.CharField("字段描述", max_length=1024, default="", blank=True)
create_time = models.DateTimeField(auto_now_add=True)
2 changes: 1 addition & 1 deletion src/init_sql/v1.10.0.sql
Original file line number Diff line number Diff line change
@@ -11,5 +11,5 @@ alter table instance_account add unique index uidx_instanceid_user_host_dbname(`
--- 增加 ssl 支持
ALTER TABLE sql_instance ADD is_ssl tinyint(1) DEFAULT 0 COMMENT '是否启用SSL';
-- 脱敏区分大小写支持,添加唯一键,避免同时配置同库同表同列添加两条脱敏规则
ALTER TABLE data_masking_columns ADD COLUMN case_sensitive TINYINT(1) NOT NULL comment '字段是否区分大小写' AFTER column_name;
ALTER TABLE data_masking_columns ADD COLUMN case_sensitive TINYINT(1) NOT NULL default 0 comment '字段是否区分大小写' AFTER column_name;
ALTER TABLE data_masking_columns ADD UNIQUE INDEX (instance_id,table_schema,table_name,column_name);