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

Inventory error #234

Open
lrnselfreliance opened this issue Jul 12, 2024 · 0 comments
Open

Inventory error #234

lrnselfreliance opened this issue Jul 12, 2024 · 0 comments

Comments

@lrnselfreliance
Copy link
Owner

Inserting any item into an inventory responds with this error:

{
    "error": "(psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint \"item_pkey\"\nDETAIL:  Key (id)=(2) already exists.\n\n[SQL: INSERT INTO item (brand, category, count, created_at, deleted_at, expiration_date, item_size, name, purchase_date, serving, subcategory, unit, inventory_id) VALUES (%(brand)s, %(category)s, %(count)s, %(created_at)s, %(deleted_at)s, %(expiration_date)s, %(item_size)s, %(name)s, %(purchase_date)s, %(serving)s, %(subcategory)s, %(unit)s, %(inventory_id)s) RETURNING item.id]\n[parameters: {'brand': 'asdf', 'category': 'dairy', 'count': Decimal('3'), 'created_at': datetime.datetime(2024, 7, 12, 4, 1, 1, 570061, tzinfo=datetime.timezone.utc), 'deleted_at': None, 'expiration_date': None, 'item_size': Decimal('1'), 'name': 'asdf', 'purchase_date': None, 'serving': None, 'subcategory': 'eggs', 'unit': 'oz', 'inventory_id': 1}]\n(Background on this error at: http://sqlalche.me/e/13/gkpj)",
    "message": null,
    "code": "IntegrityError",
    "cause": {
        "error": "duplicate key value violates unique constraint \"item_pkey\"\nDETAIL:  Key (id)=(2) already exists.\n",
        "message": null,
        "code": "UniqueViolation"
    }
}
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

No branches or pull requests

1 participant