1

I've been working through my long overdue updates. I'm now trying to go from 3.7.1 to 3.7.19 (note: I stop at increments that the CP Update list shows an "update warning triangle").

The composer update worked fine, but the migration failed, here's the migrations that were to be executed:

*Checking for pending migrations ...

  • Total 1 new Craft migration to be applied:

    - m210829_000000_element_index_tweak 
    
  • Total 3 new Social migrations to be applied:

    - m190304_031715_soft_delete_users
    - m190518_014619_soft_delete_users_fix
    - m190519_185640_soft_delete_login_accounts
    

The last migration m190519_185640_soft_delete_login_accounts failed, Here's the error:

*** applying m190519_185640_soft_delete_login_accounts Exception: SQLSTATE[42P01]: Undefined table: 7 ERROR: missing FROM-clause entry for table "userelements" LINE 5: WHERE userElements.dateDeleted IS NOT NULL ^ The SQL being executed was: SELECT "social_login_accounts"."id", "social_login_accounts"."userId" FROM "social_login_accounts" "social_login_accounts" LEFT JOIN "elements" "userElements" ON "userElements"."id" = "social_login_accounts"."userId" LEFT JOIN "elements" "loginAccountElements" ON "loginAccountElements"."id" = "social_login_accounts"."userId" WHERE userElements.dateDeleted IS NOT NULL (/home/forge/www.site.com/vendor/yiisoft/yii2/db/Schema.php:676)

It appears the table, userelements is missing?

How do I move forward? THANK YOU!

1
  • 1
    May be best to reach out to the plugin developer (Craft Social I presume?) Commented Apr 12, 2023 at 20:02

2 Answers 2

1

Thanks to your insights I was able to track down the issue; the m190519_185640_soft_delete_login_accounts file had a bug in it.

On line #28: ->where('userElements.dateDeleted IS NOT NULL')

I changed it to read: ->where('[[userElements.dateDeleted]] IS NOT NULL')

The rest of the query looks proper, just this one was missed. The github for this plugin hasn't changed since March of 2022 and I didn't see any issues reported for this migration (although there should have been one) ;-)

After making the change, I re-ran the migration and was able to progress forward.

Thank you!

0

The error is coming from the Social plugin you have installed. My guess it's a bug in one of their migrations that doesn't account for case-sensitive database collations and the fix would be to change:

WHERE userElements.dateDeleted 

to:

WHERE "userElements"."dateDeleted"

Either way, I'd suggest opening an issue on their repo, so they can investigate further: https://github.com/dukt/social/issues/

2
  • Thank you! I am really grateful for your response. It's weird that it didn't show up in composer update --dry-run.
    – Unlimited
    Commented Apr 13, 2023 at 2:28
  • Probably because composer's --dry-run doesn't know about Craft's migrations, which is where the error is happening.
    – Brad Bell
    Commented Apr 13, 2023 at 4:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.