Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sequelize table name updates

I have a table in Postgres and for ORM I am using sequelize I need to update the table name so I've tried the below migration for this

queryInterface.renameTable('table1', 'table2', { transaction }

but for some reason, it's creating a new table with table2 with the same data as table 1 but table 1 still exits with blank data.is this correct behavior of this function so'll add a delete query.

like image 349
p u Avatar asked Aug 08 '26 10:08

p u


1 Answers

This works

queryInterface.renameTable('OldTableName', 'NewTableName');

like image 148
Jatin Saradgikar Avatar answered Aug 09 '26 23:08

Jatin Saradgikar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!