Skip to content

Conversation

lukecav
Copy link
Contributor

@lukecav lukecav commented Jan 23, 2018

Added cases for tb and gb, so that terabyte and gigabyte options are supported in the db command for #80

Add cases for tb and gb, so that terabyte and gigabyte options are support in the db command.
Match the existing to use terabytes and gigabytes
define( 'MB_IN_BYTES', 1024 * KB_IN_BYTES );
}
if ( ! defined( 'GB_IN_BYTES' ) ) {
define( 'GB_IN_BYTES', 1024 * KB_IN_BYTES );
Copy link
Member

Choose a reason for hiding this comment

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

Should be 1024 * MB_IN_BYTES

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made the change.

define( 'GB_IN_BYTES', 1024 * KB_IN_BYTES );
}
if ( ! defined( 'TB_IN_BYTES' ) ) {
define( 'TB_IN_BYTES', 1024 * KB_IN_BYTES );
Copy link
Member

Choose a reason for hiding this comment

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

Should be 1024 * GB_IN_BYTES

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made the change.

Changed GB_IN_BYTES to be defined correctly in MB_IN_BYTES and TB_IN_BYTES to be defined correctly in GB_IN_BYTES
@schlessera schlessera added this to the 1.3.3 milestone Jan 23, 2018
@schlessera
Copy link
Member

Ah, I forgot to mention that we should also extend the test suite to cover these switches: https://github.com/wp-cli/db-command/blob/master/features/db-size.feature#L33-L51

@lukecav Could you add the additional test cases to the above feature file as well, please? It should be a matter of copy-pasting mostly.

Add scenarios for both gb and tb.
@schlessera schlessera merged commit 896b270 into wp-cli:master Jan 24, 2018
@schlessera schlessera changed the title Include support for tb and gb Include support for TB and GB database size formats Jan 24, 2018
@schlessera
Copy link
Member

Thanks, @lukecav !

danielbachhuber pushed a commit that referenced this pull request Nov 18, 2022
Include support for TB and GB size formats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants