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

Missing foreign key constraints #16

Closed
bruth opened this issue May 15, 2015 · 8 comments
Closed

Missing foreign key constraints #16

bruth opened this issue May 15, 2015 · 8 comments
Assignees
Labels

Comments

@bruth
Copy link

bruth commented May 15, 2015

The following foreign key constraints are not in the DDL files:

  • concept_synonym.language_concept_id
  • source_to_concept_map.source_concept_id
  • cohort_definition.subject_concept_id
  • attribute_definition.attribute_type_concept_id
@cgreich
Copy link
Contributor

cgreich commented May 16, 2015

Thanks, @bruth. Will check it out.

@clairblacketer
Copy link
Contributor

@cgreich @bruth was this ever fixed?

@bruth
Copy link
Author

bruth commented Jun 9, 2017

Hi @clairblacketer. My organization maintains a repo of data models here which includes OMOP. That repository is consumed by two services we host, one that renders the data models as browsable web pages and one that provides SQL DDL generation. This is all dynamic and driven by the files in the repository we maintain.

@bruth
Copy link
Author

bruth commented Jun 9, 2017

And to answer your question.. I am not sure if it was updated in this repo, but once we setup the data models repo, we have been updating and using that as the source of code generation.

@cgreich
Copy link
Contributor

cgreich commented Jun 10, 2017

@bruth:

This is nice. We should adopt this. How do you actually do it behind the scenes?

@bruth
Copy link
Author

bruth commented Jun 12, 2017

@burrowse Can you describe the workflow for updating versions? @aaron0browne Can you describe what has been done?

/cc @murphyke

@burrowse
Copy link

burrowse commented Aug 7, 2017

@bruth As far as updating versions, we maintain CSV files for each CDM release. These files are broken down into:

  1. Constraints - CSVs files defining all not nulls and primary keys constraints for each table in the version.
  2. Definitions - CSVs files with the OMOP definition of all columns in the version, along with reference information for the tables (e.g. _concept_ids)
  3. Indexes - CSV defining all indexes for all tables.
  4. References - CSV files defining all references/foreign key constraints.
    5)Schema - CSVs with the data type for each column in the version.

We update the CSVs for new columns or changes to columns etc so it still requires some human intervention. The service itself then validates the referential integrity. The DDL is then generated from these files.

@aaron0browne will be able to speak to the more technical piece (sql alchemy etc) of how that is done.

I apologize for the delay!

@clairblacketer clairblacketer self-assigned this Jan 11, 2018
@clairblacketer
Copy link
Contributor

closing this as the initial issue has been fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants