Merge pull request #623 from automatisch/chore/remove-default-column-values

chore: Remove default values from fields of database models
This commit is contained in:
Ömer Faruk Aydın
2022-10-19 19:58:33 +02:00
committed by GitHub
5 changed files with 13 additions and 9 deletions

View File

@@ -18,6 +18,7 @@ const createConnection = async (
return await context.currentUser.$relatedQuery('connections').insert({ return await context.currentUser.$relatedQuery('connections').insert({
key: params.input.key, key: params.input.key,
formattedData: params.input.formattedData, formattedData: params.input.formattedData,
verified: false,
}); });
}; };

View File

@@ -4,7 +4,6 @@ import { AES, enc } from 'crypto-js';
import Base from './base'; import Base from './base';
import User from './user'; import User from './user';
import Step from './step'; import Step from './step';
import App from './app';
import appConfig from '../config/app'; import appConfig from '../config/app';
import { IJSONObject } from '@automatisch/types'; import { IJSONObject } from '@automatisch/types';
import Telemetry from '../helpers/telemetry'; import Telemetry from '../helpers/telemetry';
@@ -15,7 +14,7 @@ class Connection extends Base {
data: string; data: string;
formattedData?: IJSONObject; formattedData?: IJSONObject;
userId!: string; userId!: string;
verified = false; verified: boolean;
draft: boolean; draft: boolean;
count?: number; count?: number;
flowCount?: number; flowCount?: number;
@@ -32,7 +31,7 @@ class Connection extends Base {
data: { type: 'string' }, data: { type: 'string' },
formattedData: { type: 'object' }, formattedData: { type: 'object' },
userId: { type: 'string', format: 'uuid' }, userId: { type: 'string', format: 'uuid' },
verified: { type: 'boolean' }, verified: { type: 'boolean', default: false },
draft: { type: 'boolean' }, draft: { type: 'boolean' },
}, },
}; };

View File

@@ -12,7 +12,7 @@ class ExecutionStep extends Base {
dataIn!: IJSONObject; dataIn!: IJSONObject;
dataOut!: IJSONObject; dataOut!: IJSONObject;
errorDetails: IJSONObject; errorDetails: IJSONObject;
status = 'failure'; status: 'success' | 'failure';
step: Step; step: Step;
static tableName = 'execution_steps'; static tableName = 'execution_steps';

View File

@@ -7,9 +7,9 @@ import Telemetry from '../helpers/telemetry';
class Execution extends Base { class Execution extends Base {
id!: string; id!: string;
flowId!: string; flowId!: string;
testRun = false; testRun: boolean;
internalId: string; internalId: string;
executionSteps: ExecutionStep[] = []; executionSteps: ExecutionStep[];
static tableName = 'executions'; static tableName = 'executions';
@@ -19,7 +19,7 @@ class Execution extends Base {
properties: { properties: {
id: { type: 'string', format: 'uuid' }, id: { type: 'string', format: 'uuid' },
flowId: { type: 'string', format: 'uuid' }, flowId: { type: 'string', format: 'uuid' },
testRun: { type: 'boolean' }, testRun: { type: 'boolean', default: false },
internalId: { type: 'string' }, internalId: { type: 'string' },
}, },
}; };

View File

@@ -15,7 +15,7 @@ class Step extends Base {
appKey?: string; appKey?: string;
type!: IStep['type']; type!: IStep['type'];
connectionId?: string; connectionId?: string;
status = 'incomplete'; status: 'incomplete' | 'completed';
position!: number; position!: number;
parameters: IJSONObject; parameters: IJSONObject;
connection?: Connection; connection?: Connection;
@@ -35,7 +35,11 @@ class Step extends Base {
appKey: { type: ['string', 'null'], minLength: 1, maxLength: 255 }, appKey: { type: ['string', 'null'], minLength: 1, maxLength: 255 },
type: { type: 'string', enum: ['action', 'trigger'] }, type: { type: 'string', enum: ['action', 'trigger'] },
connectionId: { type: ['string', 'null'], format: 'uuid' }, connectionId: { type: ['string', 'null'], format: 'uuid' },
status: { type: 'string', enum: ['incomplete', 'completed'] }, status: {
type: 'string',
enum: ['incomplete', 'completed'],
default: 'incomplete',
},
position: { type: 'integer' }, position: { type: 'integer' },
parameters: { type: 'object' }, parameters: { type: 'object' },
}, },