screwdriver-data-schema 25.1.2 → 25.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/config/regex.js CHANGED
@@ -67,7 +67,7 @@ module.exports = {
67
67
  EXTERNAL_TRIGGER_AND: /^sd@(\d+):(?:([\w-]+)|(stage@([\w-]+):setup))$/,
68
68
  // External trigger (OR and AND case)
69
69
  // Can be ~sd@123:component or sd@123:component
70
- EXTERNAL_TRIGGER_ALL: /^~?sd@(\d+):(?:([\w-]+)|(stage@([\w-]+):setup))$/,
70
+ EXTERNAL_TRIGGER_ALL: /^~?sd@(\d+):(([\w-]+)|(stage@([\w-]+):setup))$/,
71
71
 
72
72
  // Can be ~pr, ~commit, ~release, ~tag or ~commit:branchName, or ~sd@123:component
73
73
  // Note: if you modify this regex, you must modify `sdJoi` definition in the `config/job.js`
@@ -0,0 +1,19 @@
1
+ /* eslint-disable new-cap */
2
+
3
+ 'use strict';
4
+
5
+ const prefix = process.env.DATASTORE_SEQUELIZE_PREFIX || '';
6
+ const table = `${prefix}jobs`;
7
+
8
+ module.exports = {
9
+ // eslint-disable-next-line no-unused-vars
10
+ up: async (queryInterface, Sequelize) => {
11
+ await queryInterface.sequelize.transaction(async transaction => {
12
+ await queryInterface.addIndex(table, {
13
+ name: `${table}_pipelineId_archived`,
14
+ fields: ['pipelineId', 'archived'],
15
+ transaction
16
+ });
17
+ });
18
+ }
19
+ };
package/models/job.js CHANGED
@@ -140,5 +140,10 @@ module.exports = {
140
140
  * @property indexes
141
141
  * @type {Array}
142
142
  */
143
- indexes: [{ fields: ['pipelineId', 'state'] }, { fields: ['state'] }, { fields: ['templateId', 'archived'] }]
143
+ indexes: [
144
+ { fields: ['pipelineId', 'state'] },
145
+ { fields: ['state'] },
146
+ { fields: ['templateId', 'archived'] },
147
+ { fields: ['pipelineId', 'archived'] }
148
+ ]
144
149
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-data-schema",
3
- "version": "25.1.2",
3
+ "version": "25.1.4",
4
4
  "description": "Internal Data Schema of Screwdriver",
5
5
  "main": "index.js",
6
6
  "scripts": {