screwdriver-data-schema 22.9.14 → 22.9.16

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,32 @@
1
+ /* eslint-disable new-cap */
2
+
3
+ 'use strict';
4
+
5
+ const prefix = process.env.DATASTORE_SEQUELIZE_PREFIX || '';
6
+ const table = `${prefix}stages`;
7
+
8
+ /** @type {import('sequelize-cli').Migration} */
9
+ module.exports = {
10
+ up: async (queryInterface, Sequelize) => {
11
+ await queryInterface.sequelize.transaction(async transaction => {
12
+ await queryInterface.changeColumn(
13
+ table,
14
+ 'setup',
15
+ {
16
+ type: Sequelize.INTEGER,
17
+ allowNull: false
18
+ },
19
+ { transaction }
20
+ );
21
+ await queryInterface.changeColumn(
22
+ table,
23
+ 'teardown',
24
+ {
25
+ type: Sequelize.INTEGER,
26
+ allowNull: false
27
+ },
28
+ { transaction }
29
+ );
30
+ });
31
+ }
32
+ };
package/models/stage.js CHANGED
@@ -11,12 +11,13 @@ const MODEL = {
11
11
 
12
12
  name: Joi.string().regex(Regex.STAGE_NAME).max(110).description('Name of the Stage').example('deploy'),
13
13
 
14
- setup: Joi.number().integer().positive().description('Job ID for Stage setup').example(123345),
14
+ setup: Joi.number().integer().positive().required().description('Job ID for Stage setup').example(123345),
15
15
 
16
- teardown: Joi.number().integer().positive().description('Job ID for Stage teardown').example(123345),
16
+ teardown: Joi.number().integer().positive().required().description('Job ID for Stage teardown').example(123345),
17
17
 
18
18
  jobIds: Joi.array()
19
19
  .items(Joi.number().integer().positive().description('Identifier for this job').example(123345))
20
+ .min(1)
20
21
  .description('Job IDs in this Stage'),
21
22
 
22
23
  description: Joi.string().max(256).description('Description of the Stage').example('Deploys canary jobs'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-data-schema",
3
- "version": "22.9.14",
3
+ "version": "22.9.16",
4
4
  "description": "Internal Data Schema of Screwdriver",
5
5
  "main": "index.js",
6
6
  "scripts": {