How to correctly drop and then recreate ENUM type with sequelize for Postgres in migrations? For example this migration doesn't drop enum_Users_status enum... so any attempts to recreate/change status values after they have been once created fail.
module.exports = {
up: function (queryInterface, DataTypes) {
queryInterface.createTable('Users', {
//...
status: {
type: DataTypes.ENUM,
values: [
'online',
'offline',
],
defaultValue: 'online'
}
//...
})
},
down: function (queryInterface) {
queryInterface.dropTable('Users')
},
}
Eventually i did manage to delete the enum type inside down, but then up migration (which is supposed to create this status enum from scratch) fails, saying something like public.enum_Users_status enum type doesn't exist..