import Sequelize from "sequelize";
const DataTypes = Sequelize.DataTypes;
id: {
type: DataTypes.UUID,
allowNull: false,
primaryKey: true,
autoIncrement: true
},
an id should be generated with incrementation for every new resource thats being generated
error reported with a code 42601
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working):
NodeJS version:
Operating System:
Browser Version:
React Native Version:
Module Loader:
UUIDs can not be auto incremented. Your field definition should be
id: {
type: DataTypes.UUID,
allowNull: false,
primaryKey: true,
defaultValue: Sequelize.UUIDV4
},
So sorry for the trouble. Worked as expected per your directions.
Thanks so much!
Most helpful comment
So sorry for the trouble. Worked as expected per your directions.
Thanks so much!