Diesel: Print name of migration when running/reverting

Created on 12 Aug 2017  路  5Comments  路  Source: diesel-rs/diesel

Right now, the output of running or reverting migrations only lists the timestamp:

$ diesel migration revert
Rolling back migration 20170812171255
$ diesel migration run
Running migration 20170812171255

These aren't very informative, so it would be nice if it printed the name as well. Even just the full migration folder name would be preferable.

Diesel CLI version: 0.15.0

assigned cli

Most helpful comment

Can this issue be closed as this is fixed?

All 5 comments

@killercup I Can take this since I'm pretty familiar with that code if that's cool!

@juliusdelta Go ahead

So the first way I can think to do this would be:

  1. I could just print & parse the migration.file_path() which returns something like: "/path/diesel_cli_test/migrations/20170924041631_create_posts". Then parse it to just print 20170924041631 -> Create Posts (or something similar) and use that to replace https://github.com/diesel-rs/diesel/blob/master/diesel/src/migrations/mod.rs#L313 and corresponding revert output.

It'd have to be it's own method for sure. I'd probably call it migration_output_information() or something.

Thoughts?

Actually std::Path might have what I need to parse the path https://doc.rust-lang.org/std/path/enum.Component.html

Can this issue be closed as this is fixed?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kollapsderwellenfunktion picture kollapsderwellenfunktion  路  4Comments

orionz picture orionz  路  3Comments

kanekv picture kanekv  路  3Comments

pwoolcoc picture pwoolcoc  路  3Comments

jimmycuadra picture jimmycuadra  路  3Comments