Add a Flyway script to sanitize any constraint-violating ContentType entries in DataFile table (for ex., CR)
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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