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

Duplicate index creation #36

Closed
david-alm opened this issue Jan 5, 2021 · 2 comments
Closed

Duplicate index creation #36

david-alm opened this issue Jan 5, 2021 · 2 comments

Comments

@david-alm
Copy link

david-alm commented Jan 5, 2021

Tables containing indices trigger a DuplicateTableError even when passed the if_not_exists=True argument.

class Example(Table):
    id = Integer(primary_key=True)
    value = Varchar(length=255, index=True)
 
# Initial table creation
await Example.create_table(if_not_exists=True)
# Duplicate table creation should be idempotent
await Example.create_table(if_not_exists=True)

This causes the following error:
asyncpg.exceptions.DuplicateTableError: relation "example_value" already exists

@dantownsend
Copy link
Member

@david-alm Hi David, thanks for reporting this.

I've been able to replicate this error. It should be a pretty simple fix, so will have it fixed soon.

@dantownsend
Copy link
Member

@david-alm It should be fixed now - version 0.14.12 on PyPI, thanks.

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

2 participants