Giter Site home page Giter Site logo

Comments (7)

kehh avatar kehh commented on July 28, 2024

We've seen this before where there are foreign keys preventing this deletion. Take a look in the database to see if there's anywhere those representations are being used (either a parent representation or maybe one of the ca_{tablename}_x_object_representations). Do a query to find out what the id's of the deleted representations are. (SELECT representation_id FROM ca_object_representations WHERE deleted).

from providence.

miqrogroove avatar miqrogroove commented on July 28, 2024

@kehh Does that imply my object representations can't be deleted unless the object is also deleted? That would be... highly inconvenient.

Foreign key constraints are a likely issue. I've traced the silent failure as far as

if ($this->numErrors() > 0) {

And I was going to try to pull the codes next.

from providence.

miqrogroove avatar miqrogroove commented on July 28, 2024
     'opn_error_number' => 250,
     'ops_error_description' => 'Invalid relationship reference for representation_id',
     'ops_error_context' => 'Db->mysqli->execute()',

from providence.

miqrogroove avatar miqrogroove commented on July 28, 2024

Here's the same query sent straight to the mysql client:

mysql> DELETE FROM ca_object_representations WHERE representation_id = 5773;
ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`providence`.`ca_download_log`, CONSTRAINT `fk_ca_download_log_representation_id` FOREIGN KEY (`representation_id`) REFERENCES `ca_object_representations` (`representation_id`) ON DELETE RESTR)

from providence.

miqrogroove avatar miqrogroove commented on July 28, 2024

Good lord. So now I can't delete anything that has ever been downloaded? Is there no code to handle this?

from providence.

collectiveaccess avatar collectiveaccess commented on July 28, 2024

Purge the download log and delete whatever you want. Please keep in mind this is software for archival usage. For most users permanently deleting things is not desirable, especially if those things been interacted with (eg. downloaded).

from providence.

miqrogroove avatar miqrogroove commented on July 28, 2024

Got it but gee whiz. I'm trying to replace some representations and occasionally things get uploaded in error. Is this not a bug where I have to truncate a table to get the caUtils purge command to work as expected?

from providence.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.