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

CRM-19770 - Add is_star column to civicrm_activity #9629

Merged
merged 2 commits into from
Jan 4, 2017

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Jan 4, 2017

Fixes misplaced upgrade steps that should be in 4.7.16 instead of 4.7.15.
@@ -280,14 +280,8 @@ public function upgrade_4_7_14($rev) {
* @param string $rev
*/
public function upgrade_4_7_15($rev) {
$this->addTask('CRM-19723 - Add icon column to civicrm_option_value', 'addColumn',
'civicrm_option_value', 'icon', "varchar(255) COMMENT 'crm-i icon class' DEFAULT NULL");
$this->addTask('CRM-19626 - Add min_amount column to civicrm_price_set', 'addColumn',
Copy link
Member

Choose a reason for hiding this comment

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

For posterity: We discussed this one on Mattermost. This step is in an odd position where the 4.7.15 uses a SQL-backed upgrade and 4.7.16 uses a newer PHP-backed upgrade. However, testing shows that they end up in the same place, and they still appear mutually compatible, and the 4.7.16 code is better.

$this->addTask('CRM-19723 - Add icon column to civicrm_option_value', 'addColumn',
'civicrm_option_value', 'icon', "varchar(255) COMMENT 'crm-i icon class' DEFAULT NULL");
$this->addTask('CRM-19769 - Add color column to civicrm_tag', 'addColumn',
'civicrm_tag', 'color', "varchar(255) COMMENT 'Hex color value e.g. #ffffff' DEFAULT NULL");
Copy link
Member

Choose a reason for hiding this comment

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

Belated nitpick... and this isn't going to block #9629... but varchar(255) seems much longer than a color needs. varchar(8) is probably enough, and varchar(32) would also be pretty comfortable.

Copy link
Member Author

Choose a reason for hiding this comment

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

@totten I actually obsessed about that a little before looking it up and discovering (lo and behold)... it doesn't matter!
http://stackoverflow.com/questions/8295131/best-practices-for-sql-varchar-column-length

Copy link
Member

Choose a reason for hiding this comment

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

@colemanw interesting, my mental model of varchar(nnn) was a bit wrong!

FWIW... one of those answers cites http://stackoverflow.com/a/1151833/4195300, but it seems to give a more complicated view -- i.e. the length shouldn't affect disk usage but may affect query performance.

@totten
Copy link
Member

totten commented Jan 4, 2017

Confirmed that the revised upgrade works -- for both the new field and the refactored upgrade steps.

@totten totten merged commit a34e7e3 into civicrm:master Jan 4, 2017
@colemanw colemanw deleted the CRM-19770 branch January 4, 2017 21:48
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.

3 participants