Skip to content

Commit 8a245a9

Browse files
committed
One query = no transaction needed
1 parent 525baa3 commit 8a245a9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/bin/migrate.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@ fn main() {
2727
}
2828

2929
if table_exists("schema_migrations", &conn) {
30-
conn.transaction(|| {
31-
conn.execute("INSERT INTO __diesel_schema_migrations (
32-
SELECT version::text AS version, CURRENT_TIMESTAMP as run_on
33-
FROM schema_migrations
34-
) ON CONFLICT DO NOTHING")?;
35-
}).unwrap();
30+
conn.execute("INSERT INTO __diesel_schema_migrations (
31+
SELECT version::text AS version, CURRENT_TIMESTAMP as run_on
32+
FROM schema_migrations
33+
) ON CONFLICT DO NOTHING")?;
3634
}
3735

3836
println!("The `migrate` binary is no longer used. Use `diesel migration run` \

0 commit comments

Comments
 (0)