Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to modify the truncated length of columns of pidea_audit #1756

fredreichbier opened this issue Jul 23, 2019 · 0 comments


Copy link

commented Jul 23, 2019

The lengths of the columns of the pidea_audit table are hardcoded in the audit_column_length dictionary in

audit_column_length = {"signature": 620,

If users want to increase the column lengths, they can manually alter the SQL table (see #525). However, if PI_AUDIT_SQL_TRUNCATE is True (as it is in new installations now), the audit class will truncate fields to the lengths specified in audit_column_length even if the actual column size might be greater. It would be nice if one could increase the truncated size without having to edit

I think this could be fixed in two ways:

  • We could allow users to overwrite parts of audit_column_length in pi.cfg and use these settings in too. Then, if a user writes
    PI_AUDIT_COLUMN_LENGTHS = {"user": 40}
    in pi.cfg, a pi-manage createdb would create an audit table with an enlarged user column, and also truncate values accordingly. This way might be tricky, because when we create the models, we do not have access to the Flask app.config because the Flask app doesn't exist yet. But there might be a way to circumvent that :-)
  • Alternatively, we could require users to manually alter the column sizes, and only allow them to overwrite the truncated lengths, e.g.
    which would cause the SQL audit module to truncate the user field to 40 characters, not 20.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.