Explain the "why"
This commit is contained in:
parent
b74b959ced
commit
f764128a57
1 changed files with 2 additions and 1 deletions
|
|
@ -59,7 +59,8 @@ class Pixel(meta.Base):
|
|||
),
|
||||
sa.CheckConstraint("0 <= n_x", name="n_x_is_positive"),
|
||||
sa.CheckConstraint("0 <= n_y", name="n_y_is_positive"),
|
||||
# Needed by a `ForeignKeyConstraint` in `AddressPixelAssociation`
|
||||
# The foreign key in `AddressPixelAssociation` refers to this pair
|
||||
# => Its `.grid_id` always matches the `Pixel`'s `.grid`
|
||||
sa.UniqueConstraint("id", "grid_id"),
|
||||
# Each coordinate within the same `grid` is used at most once
|
||||
sa.UniqueConstraint("grid_id", "n_x", "n_y"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue