TechnologyRediscovery / codenforce

municipal code enforcement database application
GNU General Public License v3.0
2 stars 3 forks source link

Use Postgres Photos for parcels on map #228

Open edarsow opened 2 years ago

edarsow commented 2 years ago

Overview of how photos live in Postgresql

The actual bytes of the photo live in the column called blob in the table blobbytes. The way users interact with binary data is through a Blob object whose metadata is stored in the photodoc table. This allows for naming, describing, and linking multiple objects to the same underlying byte array without duplicating the bytes themselves. So any object that wants to connect to a photo or document has a linking table that connects that object to a record in photodoc and then photodoc has a foreign key to a single record in blobbytes called blobbytes_bytesid.

The photo that the map ultimately should grab is the bytes that are linked in the record in photodoc pointed to by the FK called broadview_photodocid on the parcel table.

Suggested design steps: