DB scheme: convert uppercase to lowercase + underscore

This commit is contained in:
Arthur Baars
2020-10-27 18:14:14 +01:00
parent bdff1fe9f4
commit bb2e7d841f
2 changed files with 12 additions and 8 deletions

View File

@@ -216,7 +216,11 @@ pub fn escape_name(name: &str) -> String {
'+' => result.push_str("plus"),
'-' => result.push_str("minus"),
'@' => result.push_str("at"),
_ => result.push_str(&c.to_lowercase().to_string()),
_ if c.is_uppercase() => {
result.push_str(&c.to_lowercase().to_string());
result.push('_')
}
_ => result.push(c),
}
}