Skip to content
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

No progress indication if a migration is slow #107

Open
RichardBradley opened this issue Jul 2, 2013 · 5 comments
Open

No progress indication if a migration is slow #107

RichardBradley opened this issue Jul 2, 2013 · 5 comments

Comments

@RichardBradley
Copy link

ruckus.php does not currently print any output until all migrations have finished.

If one or more migrations take a very long time, then this can be disconcerting. It is not clear whether ruckus.php has started or not.

It would be better if a "starting migration x" message were printed before each migration started.

(Tested on version d8b1e737 (current master) on Windows with PHP 5.4.13 + Cygwin shell)

@salimane
Copy link
Collaborator

salimane commented Jul 2, 2013

I would be checking this sometimes later this week but as usual a pull request is always welcomed.
Thanks

@ruckus
Copy link
Owner

ruckus commented Jul 9, 2013

Hmm, this is trickier than one would expect. Just shoving a printf right above the actual meat of the Migrate#run_migrations:

// OUTPUT here
printf("========= Begin: %s ======== \n", $file['class']);
$this->_adapter->start_transaction();
$result =  $obj->$target_method();
//successfully ran migration, update our version and commit
$this->_migrator_util->resolve_current_version($file['version'], $target_method);
$this->_adapter->commit_transaction();

Functionally works but the display is out of order - since the Task accumulates all output in $this->_return and then displays it at the end.

E.g.

========= Begin: CreaetFoo ========
Started: 2013-07-09 10:35am PDT

[db:migrate]:
    Migrating UP to: 20130705164951
========= Completed: CreaetFoo ======== (0.00)


Finished: 2013-07-09 10:35am PDT

Ideally we would want the ========= Begin: CreaetFoo ======== output inside the [db:migrate] block..

@marcofognog
Copy link

Is there a specific reason to why the output needs to be accumulated? Why not output everything from there?

@timtonk
Copy link
Contributor

timtonk commented Jan 23, 2014

@marcofognog maybe it's just a question of design. Instead of printing in every instance of migration there is a one method in RuckusFramework, which output everything

@kevcam4891
Copy link
Contributor

In instances where I anticipate slow queries, or major migrations, but
still want to know things are happening, I will typically fallback to
viewing tail -f of a mysql general query log. Granted, enabling the
general log will slow the process further, but sometimes I take comfort
in seeing SQL whiz through the terminal screen :)

http://dev.mysql.com/doc/refman/5.1/en/query-log.html

Dmitry Tonkonogov wrote:

@marcofognog https://github.com/marcofognog maybe it's just a
question of design. Instead of printing in every instance of migration
there is a one method in RuckusFramework, which output everything


Reply to this email directly or view it on GitHub
#107 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants