-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pipeline): add model pipelineStep
- Loading branch information
1 parent
454647c
commit 3460423
Showing
11 changed files
with
155 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
function PipelineStepConfiguration(types, models) { | ||
return { | ||
model: models.pipelineStep, | ||
actions: ['list', 'update', 'create', 'count'], | ||
list: { | ||
before: function (findOptions) { | ||
return findOptions; | ||
} | ||
} | ||
}; | ||
} | ||
exports["default"] = PipelineStepConfiguration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
var sequelize_1 = require("sequelize"); | ||
function PipelineStep(sequelize) { | ||
var PipelineStep = sequelize.define('pipelineStep', { | ||
id: { | ||
type: sequelize_1.DataTypes.INTEGER, | ||
primaryKey: true, | ||
autoIncrement: true | ||
}, | ||
jobId: { | ||
type: sequelize_1.DataTypes.INTEGER | ||
}, | ||
batchId: { | ||
type: sequelize_1.DataTypes.INTEGER | ||
}, | ||
index: { | ||
type: sequelize_1.DataTypes.INTEGER | ||
} | ||
}, { | ||
freezeTableName: true, | ||
tableName: 'pipelineStep', | ||
paranoid: true | ||
}); | ||
PipelineStep.associate = function (models) { | ||
models.job.belongsTo(models.job, { | ||
foreignKey: 'jobId', | ||
sourceKey: 'id' | ||
}); | ||
models.job.belongsTo(models.batch, { | ||
foreignKey: 'batchId', | ||
sourceKey: 'id' | ||
}); | ||
}; | ||
return PipelineStep; | ||
} | ||
exports["default"] = PipelineStep; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict' | ||
module.exports = { | ||
up: function (queryInterface, Sequelize) { | ||
return queryInterface.createTable('pipelineStep', { | ||
id: { | ||
allowNull: false, | ||
autoIncrement: true, | ||
primaryKey: true, | ||
type: Sequelize.INTEGER, | ||
}, | ||
jobId: { | ||
type: Sequelize.INTEGER, | ||
}, | ||
batchId: { | ||
type: Sequelize.INTEGER, | ||
}, | ||
index: { | ||
type: Sequelize.INTEGER, | ||
}, | ||
}) | ||
}, | ||
down: function (queryInterface) { | ||
return queryInterface.dropTable('pipelineStep') | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { | ||
InAndOutTypes, | ||
ModelDeclarationType, | ||
SequelizeModels, | ||
} from 'graphql-sequelize-generator/types' | ||
|
||
export default function PipelineStepConfiguration( | ||
types: InAndOutTypes, | ||
models: SequelizeModels | ||
): ModelDeclarationType { | ||
return { | ||
model: models.pipelineStep, | ||
actions: ['list', 'update', 'create', 'count'], | ||
list: { | ||
before: (findOptions) => { | ||
return findOptions | ||
}, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { DataTypes } from 'sequelize' | ||
|
||
export default function PipelineStep(sequelize: any) { | ||
var PipelineStep = sequelize.define( | ||
'pipelineStep', | ||
{ | ||
id: { | ||
type: DataTypes.INTEGER, | ||
primaryKey: true, | ||
autoIncrement: true, | ||
}, | ||
jobId: { | ||
type: DataTypes.INTEGER, | ||
}, | ||
batchId: { | ||
type: DataTypes.INTEGER, | ||
}, | ||
index: { | ||
type: DataTypes.INTEGER, | ||
}, | ||
}, | ||
{ | ||
freezeTableName: true, | ||
tableName: 'pipelineStep', | ||
paranoid: true, | ||
} | ||
) | ||
PipelineStep.associate = function (models: any) { | ||
models.job.belongsTo(models.job, { | ||
foreignKey: 'jobId', | ||
sourceKey: 'id', | ||
}) | ||
models.job.belongsTo(models.batch, { | ||
foreignKey: 'batchId', | ||
sourceKey: 'id', | ||
}) | ||
} | ||
return PipelineStep | ||
} |