FSTDT / fstdt

https://github.com/notriddle/more-interesting/
Mozilla Public License 2.0
0 stars 0 forks source link

Logging #14

Closed spikedee closed 7 years ago

spikedee commented 7 years ago

Should we do this in a single database table?

I‘m writing some changes to the database schema right now, and using a single table for logging is making more and more sense to me than every other table having done_by, date_of, remarks, etc. fields like the current code and database does. (Not having a single log table makes more sense there because not much is logged.)

If we go that route, how would we represent the logged event? Integers? Fixed strings? I‘m thinking the latter e.g. “comment-deleted,” “IP-banned,” “submission-edited,” or at least integers linked to fixed strings in an auxiliary table.

notriddle commented 7 years ago

Remember, Ecto has support for storing maps in the database. It ends up storing them as jsonb columns in the actual database.

spikedee commented 7 years ago

Thanks! That pretty much solves this issue. Single table.