-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat(3266): add scope and scopeId to banner models #586
Conversation
models/banner.js
Outdated
.positive() | ||
.description('Identifier to pipelineId for PIPELINE, buildId for BUILD, or null for GLOBAL') | ||
.optional() | ||
.allow(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make this non nullable when the scope
is PIPELINE
or BUILD
}, | ||
{ transaction } | ||
); | ||
await queryInterface.addColumn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we index by scope and scope id for faster look up?
Co-authored-by: Dayanand Sagar <[email protected]>
Co-authored-by: Dayanand Sagar <[email protected]>
@@ -81,7 +105,7 @@ module.exports = { | |||
* @property keys | |||
* @type {Array} | |||
*/ | |||
keys: ['message', 'type', 'createTime'], | |||
keys: ['message', 'type', 'createTime', 'scope', 'scopeId'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add a composite index having scope
and scopeId
indexes: [{ fields: ['isActive'] }, { fields: ['scope', 'scopeId'] }]
Co-authored-by: Dayanand Sagar <[email protected]>
🎉 This PR is included in version 24.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Context
The current implementation of banner schema is at the global level.
Objective
Sometimes banner is needed at the pipeline or build level only.
References
screwdriver-cd/screwdriver#3266
License
I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.