Skip to content

Commit

Permalink
More cleanup for #1725
Browse files Browse the repository at this point in the history
  • Loading branch information
tgriesser committed Oct 9, 2016
1 parent 7a04de4 commit 0e4619a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/schema/columnbuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ export default function ColumnBuilder(client, tableBuilder, type, args) {
// All of the modifier methods that can be used to modify the current query.
const modifiers = [
'default', 'defaultsTo', 'defaultTo', 'unsigned',
'nullable', 'notNull', 'first', 'after', 'comment', 'collate'
'nullable', 'first', 'after', 'comment', 'collate'
];

// Aliases for convenience.
const aliasMethod = {
default: 'defaultTo',
defaultsTo: 'defaultTo',
};

// If we call any of the modifiers (index or otherwise) on the chainable, we pretend
// as though we're calling `table.method(column)` directly.
each(modifiers, function(method) {
Expand All @@ -34,6 +40,7 @@ each(modifiers, function(method) {
};
});

ColumnBuilder.prototype.notNull =
ColumnBuilder.prototype.notNullable = function notNullable() {
return this.nullable(false)
}
Expand Down Expand Up @@ -76,12 +83,6 @@ AlterMethods.alterType = function(type) {
return this;
};

// Aliases for convenience.
const aliasMethod = {
default: 'defaultTo',
defaultsTo: 'defaultTo',
notNull: 'notNullable'
};

// Alias a few methods for clarity when processing.
const columnAlias = {
Expand Down

0 comments on commit 0e4619a

Please sign in to comment.