fix enum duplicate key error
Refactoring Request Template
Title (semantic)
Format: refactor(deploy): fix enum duplication key error at the db initialization to fix the deployment issues in the production server
Description
This merge request refactors existing code.
Issue: The enum changetype is used in the userfollows table, it is supposed to be created when the alembic migrations run, it is still uncertain why the enum was preexisting in the production environment and not in the development / local environments, i suspect the problem has something to do with alembic having problem with enums, this is a widely known issue of alembic
to bypass the duplication error, we use the if not exists clause in sql to create the enum if and only if the enum doesnt exist
Checklist
-
Code has been refactored for clarity, maintainability, or performance. -
No functional changes have been introduced. -
All existing tests are passing. -
Code adheres to project coding standards.
Related Issue(s)
Closes #
Edited by Kevin Paul Reddy Janagari