mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 The database relation fields follow the change after the primary key field is changed https://github.com/siyuan-note/siyuan/issues/11117
This commit is contained in:
parent
25ac2c0b19
commit
a4c05c25b4
2 changed files with 59 additions and 0 deletions
|
|
@ -135,3 +135,18 @@ func ContainsSubStr(s string, subStrs []string) bool {
|
|||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func ReplaceStr(strs []string, old, new string) (ret []string, changed bool) {
|
||||
if old == new {
|
||||
return strs, false
|
||||
}
|
||||
|
||||
for i, v := range strs {
|
||||
if v == old {
|
||||
strs[i] = new
|
||||
changed = true
|
||||
}
|
||||
}
|
||||
ret = strs
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue