Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

EliW's avatar
Level 1

RefreshDatabase / SQLite / Not running schema?

So I have a bunch of tests set up to use RefreshDatabase ... and I have the testing-db set to be an in-memory SQLite ...

But we currently have squashed migrations (and subsequent migrations since that) ... and it appears that RefreshDatabase isn't actually running the squashed schema at all? As none of the tables appear to exist.

But all the documentation just say to use RefreshDatabase and that magic will happen for you.

0 likes
2 replies
Tray2's avatar

Are your test failing?

You can't really inspect an in memory database. Since it's removed as soon as the tests are done.

ks500's avatar

@eliw did you ever figure out how to get around this issue? I am stuck in a similar situation and unsure what most others do in this situation. My first thought is to run the schema dump specifically for sqlite, but then I'd have to squash for postgres (which I am using) too -- since like you, I have migrations that came AFTER my initial squash.

Please or to participate in this conversation.