Giter Site home page Giter Site logo

Comments (4)

brandonkelly avatar brandonkelly commented on August 23, 2024 1

Thanks for sending that in @akiraWalk!

The root issue is that you’ve got a Matrix block row, and several Super Table block rows, which belong to elements that don’t exist anymore.

We should be clearing those out via garbage collection down the road, but I don’t think it should be a blocker for upgrading to Craft 5. So I’ve just relaxed the database’s foreign key checks for the Matrix block migration (0f7efe5) for the next release Craft 5.1.7, as well as PR’d the same change to Super Table (verbb/super-table#558).

If you want to test the fix, make sure you’re running Craft 5.1.7 or later, and change your verbb/super-table requirement in composer.json to dev-craft-5 and run composer update.

from cms.

akiraWalk avatar akiraWalk commented on August 23, 2024

the text from the screenshot for clarity

execute SQL: INSERT INTO {{%entries}} ([[id]], [[primaryOwnerId]], [[fieldId]], [[typeId]], [[postDate]], [[dateCreated]], [[dateUpdated]]) SELECT [[id]], [[primaryOwnerId]], [[fieldId]], CASE WHEN [[typeId]] = 24 THEN 30 WHEN [[typeId]] = 18 THEN 31 WHEN [[typeId]] = 21 THEN 32 WHEN [[typeId]] = 22 THEN 33 WHEN [[typeId]] = 11 THEN 34 WHEN [[typeId]] = 19 THEN 35 WHEN [[typeId]] = 20 THEN 36 WHEN [[typeId]] = 15 THEN 37 WHEN [[typeId]] = 23 THEN 38 WHEN [[typeId]] = 13 THEN 39 WHEN [[typeId]] = 16 THEN 40 WHEN [[typeId]] = 14 THEN 41 WHEN [[typeId]] = 12 THEN 42 WHEN [[typeId]] = 17 THEN 43 WHEN [[typeId]] = 8 THEN 44 WHEN [[typeId]] = 5 THEN 45 WHEN [[typeId]] = 36 THEN 46 WHEN [[typeId]] = 37 THEN 47 WHEN [[typeId]] = 32 THEN 48 WHEN [[typeId]] = 34 THEN 49 WHEN [[typeId]] = 40 THEN 50 WHEN [[typeId]] = 33 THEN 51 WHEN [[typeId]] = 38 THEN 52 WHEN [[typeId]] = 25 THEN 53 WHEN [[typeId]] = 28 THEN 54 WHEN [[typeId]] = 31 THEN 55 WHEN [[typeId]] = 39 THEN 56 WHEN [[typeId]] = 41 THEN 57 WHEN [[typeId]] = 30 THEN 58 WHEN [[typeId]] = 26 THEN 59 WHEN [[typeId]] = 27 THEN 60 WHEN [[typeId]] = 29 THEN 61 WHEN [[typeId]] = 35 THEN 62 END, [[dateCreated]], [[dateCreated]], [[dateUpdated]] FROM {{%matrixblocks}} matrixblocks WHERE [[matrixblocks.typeId]] IN (24,18,21,22,11,19,20,15,23,13,16,14,12,17,8,5,36,37,32,34,40,33,38,25,28,31,39,41,30,26,27,29,35) ...Exception: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (amcsearch_craft5.craft_entries, CONSTRAINT craft_fk_zczocrptptqdwwpqqyuzdfeerwhaxffybnnx FOREIGN KEY (primaryOwnerId) REFERENCES craft_elements (id) ON DELETE CASCADE) The SQL being executed was: INSERT INTO craft_entries (id, primaryOwnerId, fieldId, typeId, postDate, dateCreated, dateUpdated) SELECT id, primaryOwnerId, fieldId, CASE WHEN typeId= 24 THEN 30 WHENtypeId= 18 THEN 31 WHENtypeId= 21 THEN 32 WHENtypeId= 22 THEN 33 WHENtypeId= 11 THEN 34 WHENtypeId= 19 THEN 35 WHENtypeId= 20 THEN 36 WHENtypeId= 15 THEN 37 WHENtypeId= 23 THEN 38 WHENtypeId= 13 THEN 39 WHENtypeId= 16 THEN 40 WHENtypeId= 14 THEN 41 WHENtypeId= 12 THEN 42 WHENtypeId= 17 THEN 43 WHENtypeId= 8 THEN 44 WHENtypeId= 5 THEN 45 WHENtypeId= 36 THEN 46 WHENtypeId= 37 THEN 47 WHENtypeId= 32 THEN 48 WHENtypeId= 34 THEN 49 WHENtypeId= 40 THEN 50 WHENtypeId= 33 THEN 51 WHENtypeId= 38 THEN 52 WHENtypeId= 25 THEN 53 WHENtypeId= 28 THEN 54 WHENtypeId= 31 THEN 55 WHENtypeId= 39 THEN 56 WHENtypeId= 41 THEN 57 WHENtypeId= 30 THEN 58 WHENtypeId= 26 THEN 59 WHENtypeId= 27 THEN 60 WHENtypeId= 29 THEN 61 WHENtypeId= 35 THEN 62 END,dateCreated, dateCreated, dateUpdatedFROMcraft_matrixblocksmatrixblocks WHEREmatrixblocks.typeIdIN (24,18,21,22,11,19,20,15,23,13,16,14,12,17,8,5,36,37,32,34,40,33,38,25,28,31,39,41,30,26,27,29,35) (/home/webdev/www/vhosts/amcsearch-c3/craft/vendor/yiisoft/yii2/db/Schema.php:676)

from cms.

i-just avatar i-just commented on August 23, 2024

Hi, thanks for getting in touch! Could you please send your composer.json, composer.lock and database export from before you started updating to [email protected] so that we can dig deeper?

from cms.

akiraWalk avatar akiraWalk commented on August 23, 2024

Thank you, an email with the files have been sent

from cms.

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.