HomeSoftware Heritage

Support different database flavors in the SQL scripts

Description

Support different database flavors in the SQL scripts

This uses a new database table and some psql conditionals to introduce three
different flavors for the swh.storage Postgres database:

  • the 'default' flavor has all the deduplication features, foreign keys and read indexes
  • the 'mirror' flavor has all the deduplication features and read indexes; it drops some foreign keys to allow for out of order addition of some object types
  • the 'read_replica' flavor has the minimal set of indexes to support read queries, and replication using the PostgreSQL logical replication feature

Related to T2604.