Updating to SS4: Table 'Page_Versions' doesn't exist
While updating a pretty old project to SilverStripe 4 I got a weird error on dev/build:
[Emergency] Uncaught SilverStripe\ORM\Connect\DatabaseException: Couldn't run query: ALTER TABLE "Page_Versions" RENAME "_obsolete_Page_Versions" Table 'Page_Versions' doesn't exist
Of course, Page_Versions does not exist in my database, but Page_versions as it was named in old SilverStripe 2 or SilverStripe 3 installs.
How did this come? Why didn't it fail for other tables?
Basically I forgot to update my new Page class with old code; setting $db etc. properly fixes this error.