New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print name of migration when running/reverting #1091

Open
mwillsey opened this Issue Aug 12, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@mwillsey

mwillsey commented Aug 12, 2017

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

@killercup killercup added the cli label Aug 13, 2017

@juliusdelta

This comment has been minimized.

Contributor

juliusdelta commented Sep 19, 2017

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

@sgrif

This comment has been minimized.

Member

sgrif commented Sep 20, 2017

@juliusdelta Go ahead

@killercup killercup added the assigned label Sep 20, 2017

@juliusdelta

This comment has been minimized.

Contributor

juliusdelta commented Sep 24, 2017

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?

@juliusdelta

This comment has been minimized.

Contributor

juliusdelta commented Sep 24, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment