Skip to content

Commit

Permalink
Fixed primary key mapping with metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
roll committed Sep 26, 2024
1 parent 207e4f4 commit b29e45f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frictionless/formats/sql/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,8 @@ def write_schema( # type: ignore
# Primary key
if schema.primary_key:
Class = sa.UniqueConstraint if with_metadata else sa.PrimaryKeyConstraint
if not with_metadata:
constraint = Class(*schema.primary_key)
constraints.append(constraint)
constraint = Class(*schema.primary_key)
constraints.append(constraint)

# Foreign keys
for fk in schema.foreign_keys:
Expand Down

0 comments on commit b29e45f

Please sign in to comment.