chore: Add active column to flows
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
430f0d07e8
commit
02cfb979bc
@@ -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');
|
||||||
|
});
|
||||||
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
import { GraphQLList, GraphQLObjectType, GraphQLString, GraphQLInt } from 'graphql';
|
import { GraphQLList, GraphQLObjectType, GraphQLString, GraphQLInt, GraphQLBoolean } from 'graphql';
|
||||||
import StepType from './step';
|
import StepType from './step';
|
||||||
|
|
||||||
const flowType = new GraphQLObjectType({
|
const flowType = new GraphQLObjectType({
|
||||||
@@ -6,6 +6,7 @@ const flowType = new GraphQLObjectType({
|
|||||||
fields: {
|
fields: {
|
||||||
id: { type: GraphQLInt },
|
id: { type: GraphQLInt },
|
||||||
name: { type: GraphQLString },
|
name: { type: GraphQLString },
|
||||||
|
active: { type: GraphQLBoolean },
|
||||||
steps: {
|
steps: {
|
||||||
type: GraphQLList(StepType),
|
type: GraphQLList(StepType),
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,7 @@ import Step from './step'
|
|||||||
class Flow extends Base {
|
class Flow extends Base {
|
||||||
id!: number
|
id!: number
|
||||||
userId!: number
|
userId!: number
|
||||||
|
active: boolean
|
||||||
|
|
||||||
static tableName = 'flows';
|
static tableName = 'flows';
|
||||||
|
|
||||||
@@ -12,7 +13,8 @@ class Flow extends Base {
|
|||||||
|
|
||||||
properties: {
|
properties: {
|
||||||
id: { type: 'integer' },
|
id: { type: 'integer' },
|
||||||
userId: { type: 'integer' }
|
userId: { type: 'integer' },
|
||||||
|
active: { type: 'boolean' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user