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

Definite SQLAlchemy naming conventions #47

Closed
heartsucker opened this issue Oct 18, 2018 · 0 comments
Closed

Definite SQLAlchemy naming conventions #47

heartsucker opened this issue Oct 18, 2018 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@heartsucker
Copy link
Contributor

For reference: https://docs.sqlalchemy.org/en/latest/core/constraints.html#configuring-constraint-naming-conventions

We should use the recommended standard:

convention = {
  "ix": 'ix_%(column_0_label)s',
  "uq": "uq_%(table_name)s_%(column_0_name)s",
  "ck": "ck_%(table_name)s_%(constraint_name)s",
  "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s",
  "pk": "pk_%(table_name)s"
}

metadata = MetaData(naming_convention=convention)

This will save us from problems later when dealing with indexes and constraints.

@redshiftzero redshiftzero added the help wanted Extra attention is needed label Nov 5, 2018
legoktm pushed a commit that referenced this issue Dec 11, 2023
legoktm pushed a commit that referenced this issue Dec 11, 2023
Uses rsyslog based handler to log at /var/log/syslog file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants