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

[REF] SearchKit - Cleanup upgrade code #27042

Merged
merged 1 commit into from
Aug 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ext/search_kit/CRM/Search/Upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ public function upgrade_1003(): bool {
*/
public function upgrade_1005(): bool {
$this->ctx->log->info('Applying update 1005 - add acl_bypass column.');
$this->addTask('Add Cancel Button Setting to the Profile', 'addColumn',
'civicrm_search_display', 'acl_bypass', "tinyint DEFAULT 0 COMMENT 'Skip permission checks and ACLs when running this display.'");
$this->addColumn('civicrm_search_display', 'acl_bypass', "tinyint DEFAULT 0 COMMENT 'Skip permission checks and ACLs when running this display.'");
Copy link
Member Author

Choose a reason for hiding this comment

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

Note this is copied from upgrade_1001() above. If @demeritcowboy's simpler version works there, it will work here too.

return TRUE;
}

Expand Down Expand Up @@ -158,7 +157,7 @@ public function upgrade_1006(): bool {
*/
public function upgrade_1007(): bool {
$this->ctx->log->info('Applying update 1007 - add SearchSegment table.');
if (!CRM_Core_DAO::singleValueQuery("SHOW TABLES LIKE 'civicrm_search_segment'")) {
if (!CRM_Core_DAO::checkTableExists('civicrm_search_segment')) {
$createTable = "
CREATE TABLE `civicrm_search_segment` (
`id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique SearchSegment ID',
Expand Down