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

EES-5056 Adding relationship from the Content DB's Files table to the Public API DB's DataSetVersion table #4739

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

jack-hive
Copy link
Collaborator

This ticket is to implement the database relationship so that CSV Datasets and Public API datasets can be linked - and then used across the Public API workstream.

The proposed solution is to add a new PublicDataSetVersionId column to the Files table in the Content DB. This links to the Id primary key in the DataSetVersions table in the Public API DB.

The DataSetVersions table in the Public API DB currently already has the inverse relationship in the form of a CsvFileId column which corresponds to the Id primary key column of the Files table in the Content DB.

@@ -22,6 +22,8 @@ public class File : ICreatedTimestamp<DateTime?>

public int? DataSetFileVersion { get; set; }

public Guid? PublicDataSetVersionId { get; set; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be a good idea to add an index to this field by changing ContentDbContext with something like entity.HasIndex(e => e.PublicDataSetVersionId);

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it 100% would be! I intended on doing this and forgot.

Added it now :)

@benoutram benoutram added the do not merge Don't merge just yet label Apr 12, 2024
@benoutram benoutram removed the do not merge Don't merge just yet label Apr 15, 2024
@jack-hive jack-hive merged commit f2120c4 into dev Apr 15, 2024
7 checks passed
@jack-hive jack-hive deleted the EES-5056 branch April 15, 2024 11:11
sambiramairelogic pushed a commit that referenced this pull request Apr 24, 2024
… Public API DB's DataSetVersion table (#4739)

* EES-5056 Adding relationship from the Content DB's Files table to the Public API DB's DataSetVersion table

* EES-5056 Adding index to `PublicDataSetVersionId` in the `Files` table
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.

3 participants