dresende / node-orm2

Object Relational Mapping
http://github.com/dresende/node-orm2
MIT License
3.07k stars 376 forks source link

Adding a column to a table? #823

Closed napindc closed 6 years ago

napindc commented 6 years ago

Is there a way to add a column to an existing table? I changed the model on an existing table to add a new column, and I called the sync() method on the model, but it didn't add it.

dxg commented 6 years ago

Have a look at the Migrations link here: https://github.com/dresende/node-orm2#features Beyond that, there is no "automated" way. Someone started work on that once, but it was never finished.

huuthang1993 commented 4 years ago

sad, so sync is useless in prod because we can't drop the table with data to re-create