Problem/Motivation
On a clean install of the v3 Editorially module, at the point that any entity is deleted the site generates a fatal error:
Drupal\Core\Entity\EntityStorageException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'entity_id' in 'where clause': DELETE FROM "editoria11y_dismissals" WHERE ("entity_id" = :db_condition_placeholder_0)
This is because the function editoria11y_dismissals_table() does not include an entity_id column. This was added later in editoria11y_update_9004(): on a clean install of the module (as opposed to an update from an earlier version) the update hooks aren't run, and so the database created for the module has an incorrect schema.
Steps to reproduce
Install v3 of the Editorially module on a site that has not has any version of the module installed before. Check the database tables created by Drupal for the module: they do not contain an entity_id column.
Proposed resolution
The schema for all tables should be updated to include any tables and columns added later in update hooks, and an additional update hook added to rerun the required update hooks added to accommodate anyone already affected by this bug.
Comments
Comment #2
itmaybejj commentedThank you for the testing. I'll work on this.
...you...are just testing,right? V3 is not ready or use in production yet; the schema is not yet decided and there will not be update hooks between alphas.
Comment #3
mrdalesmith commentedJust testing :)
Comment #4
itmaybejj commentedFantastic. Thanks for the help then.
I'm planning to go back to the drawing board on some of these update hooks -- one of the other maintainers pointed out that at the scale of changes I need to make this time I'd be less crash prone if I just made new tables and copied over values rather than try to force schema changes in place. That should address this problem too.
Comment #5
itmaybejj commentedI think this is resolved in the 3.x dev branch.
Comment #7
itmaybejj commentedComment #8
itmaybejj commentedpfft no it's not
Comment #10
itmaybejj commented