Skip to content

Commit

Permalink
fix(core): allow merge implicit database bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Mar 13, 2020
1 parent 067d9c4 commit 238f855
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/koishi-core/src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class DatabaseManager {

injectMethods <S extends SubdatabaseType, T extends TableType> (sub: S, table: T, methods: any) {
const subdatabase = this.database[sub] as AbstractDatabase
if (!this.explicitTables[table] && this.implicitTables[table]) {
if (!this.explicitTables[table] && this.implicitTables[table] && this.implicitTables[table] !== sub) {
throw new Error(`database "${this.implicitTables[table]}" and "${sub}" conflict on table "${table}"`)
} else if (!this.explicitTables[table] || this.explicitTables[table] === sub) {
this.implicitTables[table] = sub
Expand Down

0 comments on commit 238f855

Please sign in to comment.