screwdriver-data-schema 25.10.0 → 25.11.1

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/api/loglines.js CHANGED
@@ -22,7 +22,14 @@ const SCHEMA_QUERY = Joi.object()
22
22
  type: Joi.string()
23
23
  .valid('download', 'preview')
24
24
  .default('preview')
25
- .label('Flag to trigger type either to download or preview')
25
+ .label('Flag to trigger type either to download or preview'),
26
+ timestamp: Joi.boolean().optional().default(false).description('Enable timestamp in logs'),
27
+ timestampFormat: Joi.string()
28
+ .valid('full-time', 'simple-time', 'elapsed-build', 'elapsed-step')
29
+ .optional()
30
+ .default('full-time')
31
+ .description('Timestamp format at the head of the log'),
32
+ timezone: Joi.string().optional().default('UTC').description('Timezone of timestamp in logs')
26
33
  })
27
34
  .label('Query Parameters');
28
35
 
@@ -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}events`;
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}_pipeline_id_create_time`,
14
+ fields: ['pipelineId', 'createTime'],
15
+ transaction
16
+ });
17
+ });
18
+ }
19
+ };
package/models/event.js CHANGED
@@ -183,7 +183,7 @@ module.exports = {
183
183
  * @property rangeKeys
184
184
  * @type {Array}
185
185
  */
186
- rangeKeys: ['createTime', 'pipelineId', 'type', 'groupEventId', 'parentEventId'],
186
+ rangeKeys: ['createTime', 'pipelineId', 'type', 'groupEventId', 'parentEventId', 'pipelineId'],
187
187
 
188
188
  /**
189
189
  * Tablename to be used in the datastore
@@ -204,6 +204,7 @@ module.exports = {
204
204
  { fields: ['pipelineId'] },
205
205
  { fields: ['type'] },
206
206
  { fields: ['groupEventId'] },
207
- { fields: ['parentEventId'] }
207
+ { fields: ['parentEventId'] },
208
+ { fields: ['pipelineId', 'createTime'] }
208
209
  ]
209
210
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-data-schema",
3
- "version": "25.10.0",
3
+ "version": "25.11.1",
4
4
  "description": "Internal Data Schema of Screwdriver",
5
5
  "main": "index.js",
6
6
  "scripts": {