📜  sequelize 自定义主键 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:25.699000             🧑  作者: Mango

代码示例1
class Collection extends Model {}

Collection.init({
  uid: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true // Automatically gets converted to SERIAL for postgres
  }
}, { sequelize });