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 tables without primary key #1294

Open
slavovthinks opened this issue Apr 27, 2024 · 0 comments
Open

Allow tables without primary key #1294

slavovthinks opened this issue Apr 27, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@slavovthinks
Copy link

Primary keys are not required for Relational Table definition and are especially useless for join tables. Currently if you try to define a model without a primary key you get:

/lib/python3.10/site-packages/ormar/models/helpers/sqlalchemy.py", line 250, in populate_config_tablename_columns_and_pk
    raise ormar.ModelDefinitionError("Table has to have a primary key.")
ormar.exceptions.ModelDefinitionError: Table has to have a primary key.
@slavovthinks slavovthinks added the enhancement New feature or request label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant