feat: Add draft column to connections
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
import { Knex } from 'knex';
|
||||||
|
|
||||||
|
export async function up(knex: Knex): Promise<void> {
|
||||||
|
return knex.schema.table('connections', (table) => {
|
||||||
|
table.boolean('draft').defaultTo(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function down(knex: Knex): Promise<void> {
|
||||||
|
return knex.schema.table('connections', (table) => {
|
||||||
|
table.dropColumn('draft');
|
||||||
|
});
|
||||||
|
}
|
@@ -32,6 +32,7 @@ const verifyConnection = async (
|
|||||||
...verifiedCredentials,
|
...verifiedCredentials,
|
||||||
},
|
},
|
||||||
verified: true,
|
verified: true,
|
||||||
|
draft: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
return connection;
|
return connection;
|
||||||
|
@@ -13,6 +13,7 @@ const getApp = async (_parent: unknown, params: Params, context: Context) => {
|
|||||||
.$relatedQuery('connections')
|
.$relatedQuery('connections')
|
||||||
.where({
|
.where({
|
||||||
key: params.key,
|
key: params.key,
|
||||||
|
draft: false,
|
||||||
})
|
})
|
||||||
.orderBy('created_at', 'desc');
|
.orderBy('created_at', 'desc');
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@ class Connection extends Base {
|
|||||||
formattedData?: IJSONObject;
|
formattedData?: IJSONObject;
|
||||||
userId!: string;
|
userId!: string;
|
||||||
verified = false;
|
verified = false;
|
||||||
|
draft: boolean;
|
||||||
count?: number;
|
count?: number;
|
||||||
|
|
||||||
static tableName = 'connections';
|
static tableName = 'connections';
|
||||||
@@ -29,6 +30,7 @@ class Connection extends Base {
|
|||||||
formattedData: { type: 'object' },
|
formattedData: { type: 'object' },
|
||||||
userId: { type: 'string', format: 'uuid' },
|
userId: { type: 'string', format: 'uuid' },
|
||||||
verified: { type: 'boolean' },
|
verified: { type: 'boolean' },
|
||||||
|
draft: { type: 'boolean' },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user