When upgrading to expression engine 3 to 4 you may have the following error.
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ChannelEntry_channel_titles.status_id' in 'field list': SELECT ChannelEntry_channel_titles.entry_id as ChannelEntry__entry_id, ChannelEntry_channel_titles.site_id as ChannelEntry__site_id
Ellis Labs gave the clear to add the column in to exp_channel_titles with the following config. “status_id, int (4), not null” providing exp_statuses had been created as editing the exp_channel_titles was the last step in the upgrade and the system will sometimes skip this step depending on your setup… however after reviewing this I have been running into issue due to the fact status_id conflicts with other status_id’s.
With MSM I have approx 80 different statuses across the channels and the conflicts end up removing both the status and author (randomly).
Creating the column will finish the upgrade however you may run into some oddities as a result. I’m still working with Expression Engine to resolve this.
So I managed to get to the bottom of this one, when updating Expression Engine 3 to 4, make sure you don’t have the table “exp_channels_statuses” if you do, EE will skip vital steps and although it’s possible to bring the site online you will run into issues down the line.
To solve this, change the version in your config to version 3.99.10, rename the table “exp_channels_statuses” and then re run the upgrade.