8000 update sql scheme: change keys.count field type from integer to bigint by rlikhachev · Pull Request #1976 · alerta/alerta · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

update sql scheme: change keys.count field type from integer to bigint #1976

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

Open
wants to merge 1 commit into
base: master
< 8000 div class="SelectMenu-modal">
Choose a base branch
from

Conversation

rlikhachev
Copy link
@rlikhachev rlikhachev commented Aug 8, 2024

Description
Get issue with limitations of integer type for keys.count field on Postgres db - reach limit for count of api key uses.

Fixes # #1978

Example of error:

2024-08-06 08:38:33,854 - alerta.app[7784]: ERROR - integer out of range
 [in /app/./alerta/exceptions.py:126]
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/usr/local/lib/python3.9/site-packages/flask_cors/decorator.py", line 128, in wrapped_function
    resp = make_response(f(*args, **kwargs))
  File "/app/./alerta/auth/decorators.py", line 42, in wrapped
    key_info = ApiKey.verify_key(key)
  File "/app/./alerta/models/key.py", line 165, in verify_key
    db.update_key_last_used(key)
  File "/app/./alerta/database/backends/postgres/base.py", line 1065, in update_key_last_used
    return self._updateone(update, (key, key))
  File "/app/./alerta/database/backends/postgres/base.py", line 1632, in _updateone
    cursor.execute(query, vars)
  File "/usr/local/lib/python3.9/site-packages/psycopg2/extras.py", line 312, in execute
    return super().execute(query, vars)
psycopg2.errors.NumericValueOutOfRange: integer out of range

Changes

  • alerta/sql/chema.sql:130 changed from count integer to count bigint

Screenshots
If it's a UI change add screenshots to demonstrate changes.

Checklist

  • Pull request is limited to a single purpose
  • Code style/formatting is consistent
  • All existing tests are passing
  • Added new tests related to change
  • No unnecessary whitespace changes

Collaboration
When a user creates a pull request from a fork that they own, the user
generally has the authority to decide if other users can commit to the
pull request's compare branch. If the pull request author wants greater
collaboration, they can grant maintainers of the upstream repository
(that is, anyone with push access to the upstream repository) permission
to commit to the pull request's compare branch

See https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork

Copy link
vercel bot commented Aug 8, 2024

Someone is attempting to deploy a commit to the Nick Satterly's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0