【问题标题】:How to set primary key in strapi other then id?除了id,如何在strapi中设置主键?
【发布时间】:2021-08-26 15:45:24
【问题描述】:

Strapi 在创建模型(集合)时似乎将 id 设置为主键。如何将其他关键字设置为主键,例如 Account 模型(集合)的 account_number。

我在后台使用strapi 3.6.3和最新的mysql作为数据库。

【问题讨论】:

    标签: mysql node.js database npm strapi


    【解决方案1】:

    自定义主键的能力不再是一种选择(暂时)。如果您想要一个额外的唯一、非序列整数键,建议使用 UUID 插件。

    https://forum.strapi.io/t/bookshelf-custom-id/719

    【讨论】:

      猜你喜欢
      • 2011-10-24
      • 2012-07-03
      • 2011-03-18
      • 1970-01-01
      • 1970-01-01
      • 2022-06-18
      • 2011-12-04
      • 2010-11-28
      • 2019-11-06
      相关资源
      最近更新 更多