| daniel added a comment. |
I have grepped for wb_entity_per_page in our code base, here is the result: https://phabricator.wikimedia.org/P3511
Here is a summary of places where we reference the wb_entity_per_page table, and what should be doen about them:
extensions/Wikibase/lib/includes/Store/Sql/SqlEntityInfoBuilder.php
SqlEntityInfoBuilder uses wb_entity_per_page to find the page ID and redirect information for a list of EntityIds. This can be done based on the page and redirect tables instead.
extensions/Wikibase/repo/includes/Store/Sql/PropertyInfoTableBuilder.phpPropertyInfoTableBuilder uses wb_entity_per_page to list all properties. This can be done using the page table instead, based on the namespace.
extensions/Wikibase/repo/includes/Store/Sql/EntityPerPageTable.phpThis is the big one. We will continue to need some of the me methods defined by the EntityPerPage interfaces, but not others:
- listEntities() will still be needed, can be implemented on top of the page table. Can perhaps be moved into EntityPerPageIdPager (which can then be renamed to SqlEntityIdPager).
- getEntitiesWithoutTerm() should be moved elsewhere and changed to use the page table.
- getItemsWithoutSitelinks() should be moved elsewhere and changed to use the page table.
The rest can really go:
- addEntityPage() can be dropped, we rely on the page table via WikiPage storage
- addRedirectPage() can be dropped, we rely on the redirect table via WikiPage storage
- deleteEntityPage() can be dropped from this interface, callers should be migrated to use WikiPage.
- deleteEntity() can be dropped from this interface, callers should be migrated to use EntityStore.
- clear() can be dropped.
The remaining of the occurrences of wb_entity_per_page are pointless once the changes above are implemented:
extensions/Wikibase/repo/includes/Store/Sql/EntityPerPageBuilder.php
No longer needed once no code relies on the information from wb_entity_per_page anymore.
extensions/Wikibase/repo/includes/Store/Sql/DatabaseSchemaUpdater.php extensions/Wikibase/repo/sql/Wikibase.sql extensions/Wikibase/repo/sql/AddEntityPerPage.sql extensions/Wikibase/repo/sql/AddEppRedirectTarget.sqlite.sql extensions/Wikibase/repo/sql/AddEppRedirectTarget.sql
When we no longer need the table, it can be removed from Wikibase.sql and DatabaseSchemaUpdater.php. AddEntityPerPage.sql and AddEppRedirectTarget.sqlite.sql can be dropped entirely.
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/EntityPerPageTableTest.php extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/PropertyInfoTableBuilderTest.php extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/EntityPerPageBuilderTest.php extensions/Wikibase/lib/tests/phpunit/Store/Sql/SqlEntityInfoBuilderTest.php
When the code doesn't use the table any more, the tests should obviously also stop using it.
So, we need to change three classes that still need the information from wb_entity_per_page: SqlEntityInfoBuilder, PropertyInfoTableBuilder, and EntityPerPage(Table). Then we can drop references to the table from all other parts of the code, and finally the table itself.
Cc: daniel, Aklapper, hoo, gerritbot, Magnus, Ricordisamoa, matej_suchanek, Bamyers99, Tobi_WMDE_SW, Zppix, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
