Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foreign keys should be of same type as the primary key they reference #1907

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

noahhl
Copy link
Contributor

@noahhl noahhl commented Feb 12, 2024

Ran into the same issue as linkml/linkml/#1407 -- if you have a schema like:

ClassA:
   attributes:
      id:
          identifier: true
          range: integer
ClassB:
   attributes:
      other_model:
         range: ClassA

This was generating a foreign key on ClassB of type text in all SQL derivatives, even though the key that references is an integer. This pull request switches it so foreign keys are specified by the datatype of the identifier they link to.

@noahhl noahhl force-pushed the foreign-key-type-match-issue-1407 branch 2 times, most recently from 507009e to 1a844dd Compare February 12, 2024 18:02
@noahhl noahhl force-pushed the foreign-key-type-match-issue-1407 branch from 1a844dd to b77e622 Compare February 12, 2024 18:03
Copy link

codecov bot commented Feb 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7140555) 80.05% compared to head (b77e622) 80.05%.
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1907   +/-   ##
=======================================
  Coverage   80.05%   80.05%           
=======================================
  Files         100      100           
  Lines       11500    11503    +3     
  Branches     2968     2903   -65     
=======================================
+ Hits         9206     9209    +3     
  Misses       1738     1738           
  Partials      556      556           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@cmungall cmungall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much appreciated!

@cmungall cmungall merged commit 865428a into linkml:main Feb 12, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants