feat: Create flow model and graphQL mutation

This commit is contained in:
Faruk AYDIN
2021-11-22 16:34:13 +01:00
committed by Ömer Faruk Aydın
parent b42cb759a5
commit 8a7d54bb25
12 changed files with 159 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import { Knex } from "knex";
export async function up(knex: Knex): Promise<void> {
return knex.schema.createTable('flows', (table) => {
table.increments('id');
table.string('name');
table.integer('user_id').references('id').inTable('users');
table.timestamps(true, true);
});
};
export async function down(knex: Knex): Promise<void> {
return knex.schema.dropTable('flows');
}

View File

@@ -0,0 +1,17 @@
import { Knex } from "knex";
export async function up(knex: Knex): Promise<void> {
return knex.schema.table('steps', (table) => {
table
.integer('flow_id')
.references('id')
.inTable('flows');
});
}
export async function down(knex: Knex): Promise<void> {
return knex.schema.table('steps', (table) => {
table.dropColumn('flow_id');
});
}