Q: cannot read property to String of undefined [sequelize db:migrate node.js postgres] I run 
$ sequelize db:migrate, 

but I get this result, with an ERROR 
Loaded Configuration file "db\config\config.json".
Using environment "development".
==20190927081141-add-email-to-contacts: migrating =======

ERROR: Cannot read property 'toString' of undefined

This is my current config.json file, but I don't have any toString property in it. 
//config.json

{
  "development": {
    "port":5432,
    "username": "postgres",
    "password": null,
    "database": "address-bloc-dev",
    "host": "127.0.0.1",
    "dialect": "postgres",
    "logging":false
  },
  "test": {
    "username": "postgres",
    "password": null,
    "database": "address-bloc-test",
    "host": "127.0.0.1",
    "dialect": "postgres",
    "logging": false
  }
}

Here is also the add email to contacts.js file
'use strict';
module.exports = {
  up: (queryInterface, Sequelize) => {
    return queryInterface.addColumn('Contacts', 'email',
     {
      email: {
          type: Sequelize.STRING,
      }
    });
  },
  down: (queryInterface, Sequelize) => {
    return queryInterface.removeColumn('Contacts', 'email');
  }
};

What am I doing wrong? I'm struggling in figuring it out. 
Thank you
Federico

A: Had a similar issue with
changeColumn(), ensure that that you completely define the new data type of the column that you intend to change.
Sequelize Docs
This method changes the meta data of an attribute. It is possible to change the default value, allowance of null or the data type. Please make sure, that you are completely describing the new data type.

A: This error is not coming from the config.json file, but rather the 20190927081141-add-email-to-contacts. The error is from there. 
EDIT:
What you are doing wrong is how you are setting the type of the email field.
You should do:
'use strict';
module.exports = {
  up: (queryInterface, Sequelize) => {
    return queryInterface.addColumn('Contacts', 'email',
     {
        type: Sequelize.STRING,
     });
  },
  down: (queryInterface, Sequelize) => {
    return queryInterface.removeColumn('Contacts', 'email');
  }
};


A: I have this error and the solution was to modify just a word.
the place of the error
  id:{
      ype: DataTypes.UUID,
      defaultValue: DataTypes.UUIDV1,
      primaryKey: true,
      allowNull: false,
    }

the solution was
 id:{
      type: DataTypes.UUID,
      defaultValue: DataTypes.UUIDV1,
      primaryKey: true,
      allowNull: false,
    }

just added the missing letter

A: follow steps below:

*

*install  sequelize-cli:  npm install -g sequelize-cli


*install sequelize: npm install --save sequelize


*install mysql2: npm install --save mysql2


*initialize sequelize:  sequelize init


*delete the migration and seeder directory automatically generated


*create a model (e.g user model):
 module.exports = (sequelize, DataTypes) => {
    const User = sequelize.define('users', {
      name: {
             type: Datatype.STRING,
             allowNull: false,
            },

      userRole: {
             type: Datatype.INTEGER,
             allowNull: false,
            },
  });
return User;

}


*Add db.sequelize.sync({ force: true, logging: console.log }); to your server.js after db has been defined.


*run your server
