diff --git a/migrations/20200629033313-add-column-ad-photo-to-professionals.js b/migrations/20200629033313-add-column-ad-photo-to-professionals.js new file mode 100644 index 0000000..d6fab56 --- /dev/null +++ b/migrations/20200629033313-add-column-ad-photo-to-professionals.js @@ -0,0 +1,22 @@ +'use strict'; + +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.addColumn( + 'professionals', + 'adphoto', + { + type: Sequelize.STRING(200), + allowNull: true, + defaultValue: "https://res.cloudinary.com/superpets/image/upload/v1592952182/pets/800x500_c1pdhr.jpg" + } + ); + }, + + down: (queryInterface, Sequelize) => { + return queryInterface.removeColumn( + 'pets', + 'adphoto' + ); + } +}; diff --git a/models/Professional.js b/models/Professional.js index d4ffe98..1e209e4 100644 --- a/models/Professional.js +++ b/models/Professional.js @@ -44,7 +44,11 @@ module.exports = (sequelize, Datatypes) => { neighborhood_id: { type: Datatypes.INTEGER, allowNull: false - } + }, + adphoto: { + type: Datatypes.STRING(200), + defaultValue: "https://res.cloudinary.com/superpets/image/upload/v1592952182/pets/800x500_c1pdhr.jpg" + }, }, { timestamps: false, tableName: 'professionals'