brownsys/K9db

Shuup - Table with several foreign keys to shards or PII

Closed this issue · 2 comments

Bug

  • In cases where a table has multiple non-OWNER foreign keys to a PII table, it's ambiguous for Pelton. (Pelton cannot resolve that none of them are owners)

Schema details

  FOREIGN KEY (ACCESSOR_ANONYMIZE_orderer_id) REFERENCES shuup_personcontact(id), \
  FOREIGN KEY (ACCESSOR_account_manager_id) REFERENCES shuup_personcontact(id) \
CREATE TABLE shuup_order ( \
  id int, \
  OWNER_creator_id int, \
  customer_id int, \
  ACCESSOR_modified_by_id int, \
  ACCESSOR_shop_id int, \
  ACCESSOR_ANONYMIZE_orderer_id int,
  ACCESSOR_account_manager_id int, \
  OWNS_billing_address_id int, \
  PRIMARY KEY (id), \
  FOREIGN KEY (OWNER_creator_id) REFERENCES auth_user(id), \
  FOREIGN KEY (customer_id) REFERENCES shuup_contact(id), \
  FOREIGN KEY (ACCESSOR_modified_by_id) REFERENCES auth_user(id), \
  FOREIGN KEY (ACCESSOR_shop_id) REFERENCES shuup_shop(id), \
  FOREIGN KEY (ACCESSOR_ANONYMIZE_orderer_id) REFERENCES shuup_personcontact(id), \
  FOREIGN KEY (ACCESSOR_account_manager_id) REFERENCES shuup_personcontact(id) \
);

I do not quite remember what this means. Is this still an issue?

Now resolved with new annotation