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