screwdriver-data-schema 22.9.7 → 22.9.9

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.
@@ -0,0 +1,21 @@
1
+ /* eslint-disable new-cap */
2
+
3
+ 'use strict';
4
+
5
+ const prefix = process.env.DATASTORE_SEQUELIZE_PREFIX || '';
6
+ const table = `${prefix}builds`;
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.removeIndex(table, `${table}_template_Id`, { transaction });
13
+
14
+ await queryInterface.addIndex(table, {
15
+ name: `${table}_templateId_createTime`,
16
+ fields: ['templateId', 'createTime'],
17
+ transaction
18
+ });
19
+ });
20
+ }
21
+ };
package/models/build.js CHANGED
@@ -246,6 +246,6 @@ module.exports = {
246
246
  { fields: ['eventId', 'createTime'] },
247
247
  { fields: ['jobId'] },
248
248
  { fields: [{ attribute: 'parentBuildId', length: 32 }] },
249
- { fields: ['templateId'] }
249
+ { fields: ['templateId', 'createTime'] }
250
250
  ]
251
251
  };
@@ -12,11 +12,19 @@ const mutate = require('../lib/mutate');
12
12
 
13
13
  const STATES = ['ACTIVE', 'INACTIVE'];
14
14
  const BADGE = Joi.object({
15
- name: Joi.string().max(128).description('The dashboard name for a badge').example('screwdriver/ui'),
15
+ defaultName: Joi.string()
16
+ .max(128)
17
+ .description('Auto populated dashboard name for a badge')
18
+ .example('screwdriver/ui'),
19
+ defaultUri: Joi.string()
20
+ .max(500)
21
+ .description('Auto populated url for the badge application dashboard')
22
+ .example('https://sonar.screwdriver.cd/dashboard?id=112233'),
23
+ name: Joi.string().max(128).description('The dashboard name for a badge').example('my-screwdriver/ui'),
16
24
  uri: Joi.string()
17
25
  .max(500)
18
- .description('Unique identifier for the badge application dashboard')
19
- .example('https://sonar.screwdriver.cd/dashboard?id=112233')
26
+ .description('The url the badge application dashboard')
27
+ .example('https://my-sonar.screwdriver.cd/dashboard?id=112233')
20
28
  });
21
29
 
22
30
  const CREATE_MODEL = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-data-schema",
3
- "version": "22.9.7",
3
+ "version": "22.9.9",
4
4
  "description": "Internal Data Schema of Screwdriver",
5
5
  "main": "index.js",
6
6
  "scripts": {