Skip to content

Resolve "Django's built in index naming scheme can generate collisions with a Baserow number of tables"

This issue only occurs for when we create a manual index using models.Index() on a generated table due to its own custom internal index naming algorithm creating many collisions. Indexes made via db_index=True are safe as they do include the table id in their name making them unique. Whereas the models.Index() naming algo truncates the table id from the index name, and though it still includes it in the md5 hash this is still not enough to prevent 5+ collisions per 1000 tables made on average.

Testing performed

  1. Checked out revision 9875c97f prior to migration 52 existing
  2. Created some tables and observed they have multiple order and id indexes image
  3. Upgraded to develop latest and migrated
  4. Observed that migration 52 ran and created incorrectly named indexes: image
  5. Created a new table and observed the django created indexes: image
  6. Checked out this branch and ran the migrations
  7. Observed that the first table's index has been renamed to the new format: image
  8. Observed that the second table's index has been renamed to the new format: image
  9. Created a new table and observed its new index is now correctly named: image

Merge Request Checklist

  • changelog.md has been updated if required
  • New/updated Premium features are separated correctly in the premium folder
  • The latest Chrome and Firefox have been used to test any new frontend features
  • Documentation has been updated
  • Quality Standards are met
  • Performance: tables are still fast with 100k+ rows, 100+ field tables
  • The redoc API pages have been updated for any REST API changes
  • Our custom API docs are updated for changes to endpoints accessed via api tokens
  • The UI/UX has been updated following UI Style Guide

Closes #774 (closed)

Edited by Nigel Gott

Merge request reports