Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Object #<ColumnBuilder_SQLite3> has no method 'onUpdate' #306

@elliotf

Description

@elliotf

Previously using knex 0.5.13, now using knex 0.6.6, I have migrations that have:

exports.up = function(knex, Promise) {
  var todo = [];
  todo.push(knex.schema.createTable('namespaces', function(table) {
    // unrelated columns
    table.timestamp('updated_at').defaultTo('CURRENT_TIMESTAMP').onUpdate('CURRENT_TIMESTAMP').notNullable();
  }));
  Promise.all(todo);
};

Please trust me that I am abusing the column type in this way for a good reason.

When migrating the DB via:

var db = Bookshelf.initialize(dbConfigHere);
db.knex.migrate
  .latest(dbConfigHere)
  .then(function() {
    done();
  })
  .catch(done);

I am getting:

TypeError: Object #<ColumnBuilder_SQLite3> has no method 'onUpdate'

I am going to start spelunking the code to see what's going on, but I don't see anything in the changelog for having to change migrations.

Did I miss something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions