Skip to content

Conversation

@chanmioh
Copy link
Collaborator

After migration, a document's metadata contains the SourceAttribution field, but this field does not get encoded into the database.

  • Added a SQL query for upserting the document_source table from a document metadata's SourceAttribution field.
  • Added the corresponding DB query to call SQL query.

Comment on lines +588 to +591
.map(|source| (&*source.name, &*source.link))
.multiunzip();
query_file!(
"queries/upsert_document_sources.sql",
Copy link
Collaborator

@loafofpiecrust loafofpiecrust Feb 9, 2023

Choose a reason for hiding this comment

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

I think we've got a logic mismatch here -- might need schema changes. So a source link for a particular document points to the specific record in the source archive. What we want is a single row in document_source for the Yale Beinecke library and then a document_source_citation row for every document that all point to the same document_source row. Now document_source_citation doesn't have a link/url field right now, I think it needs one added. Does that make sense?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I kind of understand, but I'm wondering why does the document_source_citation need a link/url field? I'm looking at the docs for the current schema and I see document_source_citation has source_id to link to the corresponding document_source which also has the link/url field you're talking about I assume.

image

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.

2 participants