Skip to content

Commit

Permalink
fix(schema): add alias to createTableIfNotExists (#190)
Browse files Browse the repository at this point in the history
* fix(schema): add alias to createTableIfNotExists

Closes #189

* fix(schema): incorrect docblock
  • Loading branch information
RomainLanz authored and thetutlage committed Oct 18, 2017
1 parent ab31b4c commit 1ce3d72
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/Schema/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,15 @@ class Schema {
return this.createTable(...args)
}

/**
* Alias for @ref('Schema.createTableIfNotExists')
*
* @method createIfNotExists
*/
createIfNotExists (...args) {
return this.createTableIfNotExists(...args)
}

/**
* Alias for @ref('Schema.dropTable')
*
Expand Down
2 changes: 1 addition & 1 deletion test/unit/schema.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ test.group('Schema', (group) => {
}
const userSchema = new UserSchema(ioc.use('Database'))
const fn = function () {}
userSchema.createTableIfNotExists('users', fn)
userSchema.createIfNotExists('users', fn)
assert.deepEqual(userSchema._deferredActions, [{ name: 'createTableIfNotExists', args: ['users', fn] }])
})

Expand Down

0 comments on commit 1ce3d72

Please sign in to comment.