Skip to content

Why not use jsonb instead of json for properties column at activity log table (Postgresql db)? #804

Answered by Gummibeer
igorespin asked this question in Q&A
Discussion options

You must be logged in to vote

Hey,

two things:

  1. the migration is published so you can customize it to your needs.
  2. yes, in general jsonb should be used if you are doing any JSON things in database with this column - filtering by key inside, indexing content or similar - because like you've said writing jsonb is slower and uses more storage space around/up to 30%. As this package doesn't use any json queries it would be an useless adjustment of the default migration - also because binary JSON is only supported by PostgreSQL.

If you are doing something with this column on DB side you should check if it's worth changing the column type and of so you can do it.
Depending on the amount of logged attributes per model and th…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@igorespin
Comment options

Answer selected by Gummibeer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants