chore: Add active column to flows

This commit is contained in:
Faruk AYDIN
2022-01-08 17:15:39 +03:00
committed by Ömer Faruk Aydın
parent 430f0d07e8
commit 02cfb979bc
3 changed files with 18 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
import { Knex } from "knex";
export async function up(knex: Knex): Promise<void> {
return knex.schema.table('flows', (table) => {
table.boolean('active').defaultTo(false)
});
}
export async function down(knex: Knex): Promise<void> {
return knex.schema.table('flows', (table) => {
table.dropColumn('active');
});
}

View File

@@ -1,4 +1,4 @@
import { GraphQLList, GraphQLObjectType, GraphQLString, GraphQLInt } from 'graphql';
import { GraphQLList, GraphQLObjectType, GraphQLString, GraphQLInt, GraphQLBoolean } from 'graphql';
import StepType from './step';
const flowType = new GraphQLObjectType({
@@ -6,6 +6,7 @@ const flowType = new GraphQLObjectType({
fields: {
id: { type: GraphQLInt },
name: { type: GraphQLString },
active: { type: GraphQLBoolean },
steps: {
type: GraphQLList(StepType),
}

View File

@@ -4,6 +4,7 @@ import Step from './step'
class Flow extends Base {
id!: number
userId!: number
active: boolean
static tableName = 'flows';
@@ -12,7 +13,8 @@ class Flow extends Base {
properties: {
id: { type: 'integer' },
userId: { type: 'integer' }
userId: { type: 'integer' },
active: { type: 'boolean' }
}
}