The connection history records currently stored within the Guacamole database schema are always deleted when an associated user or connection is deleted (due to "ON DELETE CASCADE"). This maintains consistency, but has a number of problems:
- Historical records become permanently unavailable if the corresponding user account or connection are deleted.
- Table replication for the sake of providing a centralized log across multiple instances is impossible as foreign keys will not necessarily be consistent across the databases.
This could be resolved by removing the dependencies on ID for context. While foreign keys should still be maintained, the table could be augmented to include connection name and username. If "ON DELETE CASCADE" is replaced with "ON DELETE SET NULL", consistency is maintained without compromising history.