2021年3月23日星期二

knex how to auto update column value?

mysql

`modify_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'modify datetime'  

javascript

knex.schema.createTable(`record_${today}`,      function (table) {          table              .datetime("modify_at")              .comment("modify date")              .notNullable()              .onUpdate(knex.fn.now());      }  );  

the code run error. it say onUpdate is not a function

https://stackoverflow.com/questions/66775055/knex-how-to-auto-update-column-value March 24, 2021 at 01:05PM

没有评论:

发表评论