Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sequelize custom primary key

class Collection extends Model {}

Collection.init({
  uid: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true // Automatically gets converted to SERIAL for postgres
  }
}, { sequelize });
Source by sequelize.org #
 
PREVIOUS NEXT
Tagged: #sequelize #custom #primary #key
ADD COMMENT
Topic
Name
6+3 =