Skip to content

Commit c0f5ee3

Browse files
committed
f with slug
1 parent b53fa10 commit c0f5ee3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/bin/sync-categories.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ fn sync(tx: &postgres::transaction::Transaction) -> postgres::Result<()> {
3232
}).collect();
3333

3434
let insert = slug_categories.iter().map(|&(ref slug, ref name)| {
35-
format!("('{}', '{}')", slug, name)
35+
format!("(LOWER('{}'), '{}')", slug, name)
3636
}).collect::<Vec<_>>().join(",");
3737

38-
let in_clause = slug_categories.iter()
39-
.map(|&(slug, _)| format!("'{}'", slug))
40-
.collect::<Vec<_>>()
41-
.join(",");
38+
let in_clause = slug_categories.iter().map(|&(slug, _)| {
39+
format!("LOWER('{}')", slug)
40+
}).collect::<Vec<_>>().join(",");
4241

4342
try!(tx.batch_execute(
4443
&format!(" \

0 commit comments

Comments
 (0)