Feathers: Sequelize Database Error - Sequelize.DataTypes.UUID fails

Created on 4 Apr 2019  路  2Comments  路  Source: feathersjs/feathers

Steps to reproduce

  • [x] create id with
import Sequelize from "sequelize";
const DataTypes = Sequelize.DataTypes;


id: {
        type: DataTypes.UUID,
        allowNull: false,
        primaryKey: true,
        autoIncrement: true
      },

Expected behavior

an id should be generated with incrementation for every new resource thats being generated

Actual behavior

error reported with a code 42601

System configuration

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:

Most helpful comment

So sorry for the trouble. Worked as expected per your directions.

Thanks so much!

All 2 comments

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rrubio picture rrubio  路  4Comments

corymsmith picture corymsmith  路  4Comments

davigmacode picture davigmacode  路  3Comments

perminder-klair picture perminder-klair  路  3Comments

NetOperatorWibby picture NetOperatorWibby  路  4Comments