Skip to content

Commit

Permalink
fix: remove commit column from build (#557)
Browse files Browse the repository at this point in the history
  • Loading branch information
klu909 authored Mar 6, 2024
1 parent c387a2b commit f0c9e1b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
13 changes: 13 additions & 0 deletions migrations/20240306-remove_column_commit_from_build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

const prefix = process.env.DATASTORE_SEQUELIZE_PREFIX || '';
const table = `${prefix}builds`;

module.exports = {
// eslint-disable-next-line no-unused-vars
async up(queryInterface, Sequelize) {
await queryInterface.sequelize.transaction(async transaction => {
await queryInterface.removeColumn(table, 'commit', { transaction });
});
}
};
3 changes: 0 additions & 3 deletions models/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const Joi = require('joi');
const mutate = require('../lib/mutate');
const Scm = require('../core/scm');
const Regex = require('../config/regex');
const Job = require('../config/job');
const Step = require('./step');
Expand Down Expand Up @@ -67,8 +66,6 @@ const MODEL = {
.description('SHA this project was built on')
.example('ccc49349d3cffbd12ea9e3d41521480b4aa5de5f'),

commit: Scm.commit,

createTime: Joi.string().isoDate().max(32).description('When this build was created'),

startTime: Joi.string().isoDate().description('When this build started on a build machine'),
Expand Down
8 changes: 0 additions & 8 deletions test/data/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ cause: Because I clicked it
environment:
DOCKER_REPO: screwdrivercd/screwdriver
sha: 46f1a0bd5592a2f9244ca321b129902a06b53e03
commit:
message: Fixing a bug with signing
author:
url: https://github.com/stjohnjohnson
name: St. John Johnson
username: stjohnjohnson
avatar: https://avatars.githubusercontent.com/u/622065?v=3
url: https://github.com/scredriver-cd/screwdriver/commit/46f1a0bd5592a2f9244ca321b129902a06b53e03
createTime: "2038-01-19T03:14:08.131Z"
startTime: "2038-01-19T03:15:08.131Z"
endTime: "2038-01-19T03:16:10.131Z"
Expand Down

0 comments on commit f0c9e1b

Please sign in to comment.