Utility for replacing PostgreSQL ENUM values in Sequelize migrations. Version 1.6.0 is current, with irregular release cadence. It provides a single function to safely add/remove enum values without dropping and recreating the column, avoiding common pitfalls. Key differentiator: handles complex cases like columns with default values and custom enum names, unlike raw SQL approaches. Only supports PostgreSQL with Sequelize.
npm install sequelize-replace-enum-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Migration using replaceEnum to add 'on-demand' to an existing ENUM column.
Always provide the exact PostgreSQL enum name as shown in the database schema.
Ensure defaultValue is among the current enum values (not an empty string or invalid).
Manually drop dependencies before running the migration, or use a transactional approach.
Ensure newValues is the complete set of enum values after migration.
Use require('sequelize-replace-enum-postgres').default to get the function.Use 'import replaceEnum from "sequelize-replace-enum-postgres"'
Double-check the exact column and table names from your Sequelize models.
No dependency data recorded yet.