diff --git a/docs/clients/server/postgres/schemagrammar.html b/docs/clients/server/postgres/schemagrammar.html index e330cb0a5..d33e05296 100644 --- a/docs/clients/server/postgres/schemagrammar.html +++ b/docs/clients/server/postgres/schemagrammar.html @@ -55,6 +55,8 @@ }, this)); },

Create the column definition for a integer type.

typeInteger: function(column) { return column.autoIncrement ? 'serial' : 'integer'; + },

Create the column definition for a bigint type.

typeBigInteger: function(column) { + return column.autoIncrement ? 'bigserial' : 'bigint'; },

Create the column definition for a tiny integer type.

typeTinyInteger: function() { return 'smallint'; },

Create the column definition for a float type.

typeFloat: function() { diff --git a/docs/knex.html b/docs/knex.html index d94af04b1..11f44f970 100644 --- a/docs/knex.html +++ b/docs/knex.html @@ -11,6 +11,7 @@ each of which are injected with the current instance, so they maintain the correct client reference & grammar.

var Raw = require('./lib/raw').Raw; var Transaction = require('./lib/transaction').Transaction; var Builder = require('./lib/builder').Builder; + var Promise = require('./lib/promise').Promise; var ClientBase = require('./clients/base').ClientBase; var SchemaBuilder = require('./lib/schemabuilder').SchemaBuilder; @@ -48,7 +49,10 @@ rather than wait on an async load of a client library.

knex.schema.dropTableIfExists('tableName');

_.each(SchemaInterface, function(val, key) { knex.schema[key] = function() { var schemaBuilder = new SchemaBuilder(knex); - schemaBuilder.table = _.first(arguments); + var table = schemaBuilder.table = _.first(arguments); + if (!table) { + return Promise.reject(new Error('The table must be defined for the ' + key + ' method.')); + } return SchemaInterface[key].apply(schemaBuilder, _.rest(arguments)); }; });

Method to run a new Raw query on the current client.

knex.raw = function(sql, bindings) { diff --git a/index.html b/index.html index 34f555355..68fc847a7 100644 --- a/index.html +++ b/index.html @@ -1146,8 +1146,7 @@ knex.schema.table('users', function (table) {

incrementstable.increments(name)
- Adds an auto incrementing column, . This will be used as the primary key for the column. - Also available is a bigIncrements if you + Adds an auto incrementing column, in PostgreSQL this is a serial. This will be used as the primary key for the column. Also available is a bigIncrements if you wish to add a bigint incrementing number (in PostgreSQL bigserial).

@@ -1156,10 +1155,11 @@ knex.schema.table('users', function (table) { Adds an integer column.

-

+

integertable.integer(name)
- In MySQL, adds a bigint column, otherwise adds a normal integer. + In MySQL or PostgreSQL, adds a bigint column, + otherwise adds a normal integer.

@@ -1473,6 +1473,7 @@ process.stderr.on('data', function() {

  • Initial pass at a migration api.
  • Aggregate methods are no longer aliased as "aggregate", but may now be aliased and have more than one aggregate in a query (#108, #110).
  • +
  • Adding bigint and bigserial to PostgreSQL (#111).
  • Bugfix on increment/decrement values (#100).
  • Bugfix with having method (#107).
  • Switched from when.js to bluebird for promise implementation, with shim for backward compatibility.