代码之家  ›  专栏  ›  技术社区  ›  Lin Du Correcter

是否有必要在“.increment()”方法之后使用“.primary()”方法?

  •  0
  • Lin Du Correcter  · 技术社区  · 7 年前

    我读 knex.js docs和find在一些示例之间有一点不同。

    https://knexjs.org/#Schema-createTable 使用 table.increment()

    https://knexjs.org/#Schema-hasTable table.increment().primary()

    它们相等吗?

    1 回复  |  直到 7 年前
        1
  •  0
  •   Mikael Lepistö    7 年前

    是的,它们是等价的。 .increment