Hi Mike,
Thanks for your feedback. I'll leave your suggestion here if anyone comes
across this:
from sqlalchemy import event, Table
@event.listens_for(Table, 'before_create')
def add_index_on_foreign_key_columns(table, connection, **kwargs):
for foreign_key in
On Fri, Jun 25, 2021, at 11:58 AM, mkmo...@gmail.com wrote:
>
> When using PostgreSQL, creating a foreign key on a column in a table does not
> automatically index that column, unlike Oracle or MySQL.
>
> I would like to get SQLAlchemy to automatically create an index on the same
> columns
When using PostgreSQL, creating a foreign key on a column in a table does
not automatically index that column, unlike Oracle or MySQL.
I would like to get SQLAlchemy to automatically create an index on the same
columns that are specified in a ForeingKeyConstraint.
For example, if I have a