Open Forceres opened 1 month ago
@Forceres You can use unique constraints in the on_conflict
target argument as described here, but you need to add unique=True
to each separate column in the table definition. The issue with adding a composite unique constraint to multiple columns at once will be resolved by this PR. For now, the workaround is to use raw sql (in migrations or script) to add a composite unique constraint, as described here.
@Forceres You can use unique constraints in the
on_conflict
target argument as described here, but you need to addunique=True
to each separate column in the table definition. The issue with adding a composite unique constraint to multiple columns at once will be resolved by this PR. For now, the workaround is to use raw sql (in migrations or script) to add a composite unique constraint, as described here.
Yeah, made compound indexes via raw SQL (not a good approach)
Is here a way to create compound unique indexes and use them in insert.on_conflict(target=unique_constraint)?