'How to add a new column to an existing table in Sequelize

I'm trying to add a new column in my Front-App and send it to the api to add a new column to existing table with Sequelize with the same name i add it in Front,and update the model.I have seen addColumn but i don't understand where and how to use it. If somebody can help with that i will be very grateful.



Solution 1:[1]

You can use Query interface for this. Whenever you are making an API call, read the request and a column using addColumn as you said.

queryInterface.addColumn(<TableName>, 'ColumnName', { type: <DataType> });

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mchowdam