feat: Create execution model

This commit is contained in:
Faruk AYDIN
2022-02-19 12:38:15 +03:00
committed by Ömer Faruk Aydın
parent 3457ad29d7
commit 82e1f345d4
2 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
import Base from './base';
import Flow from './flow';
class Execution extends Base {
id!: string;
flowId!: number;
testRun: boolean;
static tableName = 'executions';
static jsonSchema = {
type: 'object',
properties: {
id: { type: 'string' },
flowId: { type: 'integer' },
testRun: { type: 'boolean' },
},
};
static relationMappings = () => ({
flow: {
relation: Base.BelongsToOneRelation,
modelClass: Flow,
join: {
from: 'executions.flow_id',
to: 'flows.id',
},
},
});
}
export default Execution;