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 missing indexes and a new index to jobs #1824

Merged
merged 1 commit into from
Jul 25, 2024
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
8 changes: 8 additions & 0 deletions plugins/Jobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ void BedrockPlugin_Jobs::upgradeDatabase(SQLite& db) {
SASSERT(db.verifyIndex("jobsName", "jobs", "( name )", false, !BedrockPlugin_Jobs::isLive));
SASSERT(db.verifyIndex("jobsParentJobIDState", "jobs", "( parentJobID, state ) WHERE parentJobID != 0", false, !BedrockPlugin_Jobs::isLive));
SASSERT(db.verifyIndex("jobsStatePriorityNextRunName", "jobs", "( state, priority, nextRun, name )", false, !BedrockPlugin_Jobs::isLive));
SASSERT(db.verifyIndex("jobsPriorityNextRunManualSmartScanMerchantAndCategory", "jobs", "(priority, nextRun) WHERE state IN ('QUEUED', 'RUNQUEUED') AND name GLOB 'manual/SmartScanMerchantAndCategory*'", false, !BedrockPlugin_Jobs::isLive));
SASSERT(db.verifyIndex("jobsPriorityNextRunManualSmartScanAmountAndCurrency", "jobs", "(priority, nextRun) WHERE state IN ('QUEUED', 'RUNQUEUED') AND name GLOB 'manual/SmartScanAmountAndCurrency*'", false, !BedrockPlugin_Jobs::isLive));
SASSERT(db.verifyIndex("jobsPriorityNextRunManualSmartScanCreated", "jobs", "(priority, nextRun) WHERE state IN ('QUEUED', 'RUNQUEUED') AND name GLOB 'manual/SmartScanCreated*'", false, !BedrockPlugin_Jobs::isLive));
SASSERT(db.verifyIndex("jobsPriorityNextRunManualSmartScanIsCash", "jobs", "(priority, nextRun) WHERE state IN ('QUEUED', 'RUNQUEUED') AND name GLOB 'manual/SmartScanIsCash*'", false, !BedrockPlugin_Jobs::isLive));
SASSERT(db.verifyIndex("jobsPriorityNextRunManualSmartScan", "jobs", "(priority, nextRun) WHERE state IN ('QUEUED', 'RUNQUEUED') AND name GLOB 'manual/SmartScan*'", false, !BedrockPlugin_Jobs::isLive));
SASSERT(db.verifyIndex("jobsManualSmartscanReceiptID", "jobs", "( JSON_EXTRACT(data, '$.receiptID') ) WHERE JSON_VALID(data) AND name GLOB 'manual/SmartScan*'", false, !BedrockPlugin_Jobs::isLive));
SASSERT(db.verifyIndex("jobsPriorityNextRunWWWProd", "jobs", "(priority, nextRun) WHERE state IN ('QUEUED', 'RUNQUEUED') AND name GLOB 'www-prod/*'", false, !BedrockPlugin_Jobs::isLive));
SASSERT(db.verifyIndex("jobsPriorityNextRunWWWStag", "jobs", "(priority, nextRun) WHERE state IN ('QUEUED', 'RUNQUEUED') AND name GLOB 'www-stag/*'", false, !BedrockPlugin_Jobs::isLive));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the new index, the rest of them I got them from prod.

}

// ==========================================================================
Expand Down