IQSS / IQSS/dataverse

Add a Flyway script to sanitize any constraint-violating ContentType entries in DataFile table (for ex., CR)

Open
#8,316 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
564
Avg merge
2d 2h
Merged PRs (30d)
29

Description

but who would have carriage returns in their contenttype fields, you ask? why, we do, of course.

This only manifests when checksumvalue must be replaced in the database - if no replacement is required, the API returns:
{"status":"OK","data":{"message":"Datafile rehashing complete. datafile_id successfully rehashed. New hash value is: new_hash_value"}}

To reproduce:

=> update datafile set contenttype='application/x-sas-transport
'> ' where id='datafile_id;
=> update datafile set checksumvalue='' where id='datafile_id';

Then call /api/admin/computeDataFileHashValue/datafile_id/algorithm/MD5

Leonid notes that there are other installations as old as Odum's, so this could potentially come up again. He'd like a flyway script to clean up such contenttype entries.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No migration file is named. Start by locating existing Flyway migrations and the DataFile table definition, then review the supplied SQL reproduction and the computeDataFileHashValue endpoint behavior. Done means a Flyway migration cleans existing constraint-violating ContentType values, including carriage returns, without changing valid entries.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.