screwdriver-data-schema 21.25.0 → 21.25.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.
@@ -47,7 +47,7 @@ module.exports = {
47
47
  });
48
48
 
49
49
  await queryInterface.addIndex(table, {
50
- name: `${prefix}_pipeline_id`,
50
+ name: `${table}_pipeline_id`,
51
51
  fields: ['pipelineId'],
52
52
  transaction
53
53
  });
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ const prefix = process.env.DATASTORE_SEQUELIZE_PREFIX || '';
4
+ const table = `${prefix}jobs`;
5
+
6
+ module.exports = {
7
+ // eslint-disable-next-line no-unused-vars
8
+ async up(queryInterface, Sequelize) {
9
+ await queryInterface.sequelize.transaction(async transaction => {
10
+ const dialect = queryInterface.sequelize.getDialect();
11
+ // sqlite
12
+ let query = `DELETE FROM "${table}" WHERE "name" LIKE 'PR-%' AND INSTR(name, ':') = 0`;
13
+
14
+ if (dialect === 'postgres') {
15
+ query = `DELETE FROM "${table}" WHERE "name" LIKE 'PR-%' AND POSITION(':' IN "name") = 0`;
16
+ } else if (dialect === 'mysql') {
17
+ query = `DELETE FROM \`${table}\` WHERE name LIKE 'PR-%' AND POSITION(':' IN name) = 0`;
18
+ }
19
+
20
+ await queryInterface.sequelize.query(query, { transaction });
21
+ });
22
+ }
23
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-data-schema",
3
- "version": "21.25.0",
3
+ "version": "21.25.1",
4
4
  "description": "Internal Data Schema of Screwdriver",
5
5
  "main": "index.js",
6
6
  "scripts": {