Skip to content

Add "tableName" to execution log - #41

Open
Restuta wants to merge 1 commit into
flexxnn:masterfrom
Restuta:patch-2
Open

Add "tableName" to execution log#41
Restuta wants to merge 1 commit into
flexxnn:masterfrom
Restuta:patch-2

Conversation

@Restuta

@Restuta Restuta commented Feb 18, 2019

Copy link
Copy Markdown

Just makes output a little more readable.

Comment thread lib/migrate.js
{
let command = migrationCommands[index];
console.log("[#"+index+"] execute: " + command.fn);
const tableName = (command.params && command.params[0]) || '<no table name>'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This project already depends on lodash. You could consider doing this instead:

const tableName = _.get(command, 'params[0]', '<no table name>');

@Restuta Restuta Mar 17, 2019

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PaulMest thanks, I considered and in this specific case I feel like it comes down to personal preference, I don't see strong advantage of one or the other approach for the level of nesting of 2. For fields that are 3+ levels deep I think _.get has significant advantages.

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

Successfully merging this pull request may close these issues.

2 participants