-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't working
Description
As a developer, I want to make sure I can run the backend without causing a new index to be created in certain tables.
Tasks:
- This issue is happening because of the app.js file in ycphacks-api. This file uses sequelize.sync() with the “alter: true” option. When Sequelize runs in “alter” mode, it generates multiple ALTER TABLE statements over time, which can create duplicate indexes, especially on columns with UNIQUE constraints (e.g., email in the User table). Eventually, MySQL reaches its limit of 64 indexes per table, causing sync errors.
- We will need to talk about how to fix this, but one idea is to add a .env variable that each person can individually set to “alter”, “force”, or “none”, depending on what they want Sequelize to do. In this setup, you would only want to use “alter”/”force” when you just pulled in new changes from main that made changes to the Sequelize model files. To fix duplicate indexes, you would set this .env variable in all other cases to “none”.
Milestone: Stretch Goal
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working