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

Add support for output from migration scripts #12

Open
nmummau opened this issue Jul 24, 2019 · 0 comments
Open

Add support for output from migration scripts #12

nmummau opened this issue Jul 24, 2019 · 0 comments

Comments

@nmummau
Copy link

nmummau commented Jul 24, 2019

It would be nice if output from sql migration scripts would be printed in the terminal.
For example, currently when running postgrator 0020 the terminal output is as follows.

[7:01:25 PM] version of database is: 10
[7:01:25 PM] migrating up to 20
[7:01:25 PM] verifying checksum of migration 0010.do.create role admin_users.sql
[7:01:25 PM] running 0020.do.create role app_users.sql

In my 0020.do.create role app_users.sql file I have SELECT output like this (examples):

SELECT CONCAT(
   to_char(current_timestamp, '[HH12:MI:SS PM]'), ' Beginning script'
);
--do work
--do more work
SELECT CONCAT(
   to_char(current_timestamp, '[HH12:MI:SS PM]'), ' Beginning transaction'
);
--commit the transaction
SELECT CONCAT(
   to_char(current_timestamp, '[HH12:MI:SS PM]'), 'Transaction complete - 50 rows inserted'
);

It would be great if I could get this as output in the terminal (emphasizing the hypothetical last 3 lines):

[7:01:25 PM] version of database is: 10
[7:01:25 PM] migrating up to 20
[7:01:25 PM] verifying checksum of migration 0010.do.create role admin_users.sql
[7:01:25 PM] running 0020.do.create role app_users.sql
[7:01:25 PM] Beginning script
[7:01:28 PM] Beginning transaction
[7:02:06 PM] Transaction complete - 50 rows inserted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants