marbobo's avatar
Level 12

lumen testing choosing between DatabaseMigration Vs DatabaseTransaction

Hi guys, I like to know what you use on your tests. And what is the best test scenario where you will use DatabaseMigration over DatabaseTransaction and vise versa.

0 likes
5 replies
marbobo's avatar
Level 12

sorry i forgot to mention that the project I am working is lumen. and I think refreshdatabase is not available on lumen

tykus's avatar
tykus
Best Answer
Level 104

In that case; I would consider/anticipate whether my application has a lot of changes to the Schema as I develop. Rolling back a transaction is quicker than re-running all of the migrations. More migrations, then the test suite will be slower to run. But something/someone must ensure the test database schema is correct.

1 like
marbobo's avatar
Level 12

thank you.. i did the same.. do you think theres a huge disadvantages using DatabaseTransaction instead of DatabaseMigration?

tykus's avatar

Managing the state of the Schema manually.

Please or to participate in this conversation.