Skip to content

Commit a9447a0

Browse files
jdieterrafiss
authored andcommitted
Add details to explanatory comment
Signed-off-by: Jonathan Dieter <jonathan.dieter@spearline.com>
1 parent 18d88c9 commit a9447a0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cockroachdb/sqlalchemy/dialect.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@ def get_columns(self, conn, table_name, schema=None, **kw):
257257
def get_indexes(self, conn, table_name, schema=None, **kw):
258258
if self._is_v192plus:
259259
indexes = super().get_indexes(conn, table_name, schema, **kw)
260-
# We need to remove the `duplicates_constraints` value from unique indexes, otherwise
260+
# CockroachDB creates a UNIQUE INDEX automatically for each UNIQUE CONSTRAINT, and
261+
# there is no difference between unique indexes and unique constraints. We need
262+
# to remove the `duplicates_constraints` value from unique indexes, otherwise
261263
# alembic tries to delete and recreate unique indexes. This is consistent with
262264
# postgresql which doesn't set the duplicates_constraint flag on unique indexes
263265
for index in indexes:

0 commit comments

Comments
 (0)