mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
modify schema primary keys to be nullable+defaulted
This fixes SQLAlchemy warnings related to primary keys not having an auto_increment or nullable. We've done this by making all foreign primary keys nullable. In ApiRateLimit's case, we can set a default str to act as a null, which seems a bit more sensible. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
e5df083d45
commit
d7481b9649
5 changed files with 42 additions and 11 deletions
|
@ -19,11 +19,9 @@ def test_api_rate_key_creation():
|
|||
assert rate.WindowStart == 1
|
||||
|
||||
|
||||
def test_api_rate_key_null_ip_raises_exception():
|
||||
from aurweb.db import session
|
||||
with pytest.raises(IntegrityError):
|
||||
create(ApiRateLimit, Requests=10, WindowStart=1)
|
||||
session.rollback()
|
||||
def test_api_rate_key_ip_default():
|
||||
api_rate_limit = create(ApiRateLimit, Requests=10, WindowStart=1)
|
||||
assert api_rate_limit.IP == str()
|
||||
|
||||
|
||||
def test_api_rate_key_null_requests_raises_exception():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue