cli icon indicating copy to clipboard operation
cli copied to clipboard

Add option for a dry run

Open sankethkatta opened this issue 9 years ago • 23 comments

Some other migration frameworks such as node-db-migrate offer a --dry-run option. This simply prints out all the SQL statements that would be run, but does not actually touch the database.

This can be a very useful check prior to running a migration on a database with real data. It also can be a bit of a sanity checker, unlike normal database queries, migrations are difficult to write tests for. So this would also allow developers to actually verify that their migration file runs, without running it.

I'd be happy to work on a PR with some direction on where to get started, would this involve changes in Sequelize?

sankethkatta avatar Nov 06 '15 16:11 sankethkatta

+1

larslbert avatar Dec 15 '15 22:12 larslbert

+1

shamoons avatar Mar 05 '16 15:03 shamoons

+1

rayder441 avatar Mar 14 '16 17:03 rayder441

+1

w43l avatar Jul 26 '16 20:07 w43l

+1

andrew-makarenko avatar Jan 05 '17 14:01 andrew-makarenko

+1

iagomls avatar Jan 12 '17 18:01 iagomls

+1

There has to be a way to do this, now, I'd think. Even if it's not officially supported, it would seem as though you could call a few private methods or, something, to get the query generation without the execution. Either way, I'll look into it, but wanted to register my +1 anyway.

vmadman avatar Sep 05 '17 23:09 vmadman

+1

vadivelselvaraj avatar Mar 06 '18 19:03 vadivelselvaraj

+1

damianobarbati avatar Aug 13 '18 12:08 damianobarbati

+1

madshell avatar Sep 20 '18 13:09 madshell

+1

webjaros avatar Oct 20 '18 16:10 webjaros

+1

webjaros avatar Oct 24 '18 20:10 webjaros

+1

mk7upurz87 avatar Nov 08 '18 20:11 mk7upurz87

+1

miahorg avatar Dec 03 '18 17:12 miahorg

+1,000

robert-krikey avatar Jan 17 '19 18:01 robert-krikey

+1

letsspeak avatar Feb 01 '19 05:02 letsspeak

+1

This is definitely a necessary feature.

smddzcy avatar Sep 21 '19 11:09 smddzcy

And put db:sync --dry-run into sequelize-cli as option!

vbabak avatar Jan 27 '20 16:01 vbabak

Also need option for sync() API like this: sequelize.sync({ dry: true, force: true });

mrdulin avatar Feb 13 '20 10:02 mrdulin

Please some workaround for this?

frederikhors avatar Apr 01 '20 19:04 frederikhors

Is there any latest news?

ZQ-jhon avatar Apr 04 '22 05:04 ZQ-jhon

What is the status here ???? From 2015 until noooww !

ghyath5 avatar Jun 27 '22 15:06 ghyath5

Bumping for more attention!!!

20kaushik02 avatar Oct 02 '22 22:10 20kaushik02