Skip to content

Commit

Permalink
Add ._createTables() method to KnexAdapter (keystonejs#2270)
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie authored Jan 21, 2020
1 parent 7567b58 commit c335a19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/big-moons-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/adapter-knex': patch
---

Added an internal method `_createTables()` to factor out table creation.
3 changes: 3 additions & 0 deletions packages/adapter-knex/lib/adapter-knex.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ class KnexAdapter extends BaseKeystoneAdapter {
} else {
return [];
}
return this._createTables();
}

async _createTables() {
const createResult = await pSettle(
Object.values(this.listAdapters).map(listAdapter => listAdapter.createTable())
);
Expand Down

0 comments on commit c335a19

Please sign in to comment.