<p>Thanks to your insights I was able to track down the issue; the <code>m190519_185640_soft_delete_login_accounts</code> file had a bug in it.</p>
<p>On line #28: <code>-&gt;where('userElements.dateDeleted IS NOT NULL')</code></p>
<p>I changed it to read: <code>-&gt;where('[[userElements.dateDeleted]] IS NOT NULL')</code></p>
<p>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) ;-)</p>
<p>After making the change, I re-ran the migration and was able to progress forward.</p>
<p>Thank you!</p>

CC BY-SA 4.0
2023-04-14T15:43:44.407Z
2023-04-14T18:57:31.213Z
2023-04-14T18:57:31.213Z
Unlimited
<p>The error is coming from the <a href="https://plugins.craftcms.com/social?craft3" rel="nofollow noreferrer">Social plugin</a> 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:</p>
<pre><code>WHERE userElements.dateDeleted 
</code></pre>
<p>to:</p>
<pre><code>WHERE &quot;userElements&quot;.&quot;dateDeleted&quot;
</code></pre>
<p>Either way, I'd suggest opening an issue on their repo, so they can investigate further:  <a href="https://github.com/dukt/social/issues/" rel="nofollow noreferrer">https://github.com/dukt/social/issues/</a></p>

CC BY-SA 4.0
2023-04-13T02:28:29.603Z
Thank you! I am really grateful for your response. It's weird that it didn't show up in composer update --dry-run.
Unlimited
CC BY-SA 4.0
2023-04-13T04:45:58.430Z
Probably because composer's `--dry-run` doesn't know about Craft's migrations, which is where the error is happening.
Brad Bell
CC BY-SA 4.0
2023-04-12T21:43:43.940Z
2023-04-12T21:43:43.940Z
Brad Bell
<p>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 &quot;update warning triangle&quot;).</p>
<p>The composer update worked fine, but the migration failed, here's the migrations that were to be executed:</p>
<p>*Checking for pending migrations ...</p>
<ul>
<li><p>Total 1 new Craft migration to be applied:</p>
<pre><code>- m210829_000000_element_index_tweak 
</code></pre>
</li>
<li><p>Total 3 new Social migrations to be applied:</p>
<pre><code>- m190304_031715_soft_delete_users
- m190518_014619_soft_delete_users_fix
- m190519_185640_soft_delete_login_accounts
</code></pre>
</li>
</ul>
<p>The last migration <code>m190519_185640_soft_delete_login_accounts</code> failed, Here's the error:</p>
<blockquote>
<p>*** applying m190519_185640_soft_delete_login_accounts
Exception: SQLSTATE[42P01]: Undefined table: 7 ERROR:  missing FROM-clause entry for table &quot;userelements&quot;
LINE 5: WHERE userElements.dateDeleted IS NOT NULL
^
The SQL being executed was: SELECT &quot;social_login_accounts&quot;.&quot;id&quot;, &quot;social_login_accounts&quot;.&quot;userId&quot;
FROM &quot;social_login_accounts&quot; &quot;social_login_accounts&quot;
LEFT JOIN &quot;elements&quot; &quot;userElements&quot; ON &quot;userElements&quot;.&quot;id&quot; = &quot;social_login_accounts&quot;.&quot;userId&quot;
LEFT JOIN &quot;elements&quot; &quot;loginAccountElements&quot; ON &quot;loginAccountElements&quot;.&quot;id&quot; = &quot;social_login_accounts&quot;.&quot;userId&quot;
WHERE userElements.dateDeleted IS NOT NULL (/home/forge/www.site.com/vendor/yiisoft/yii2/db/Schema.php:676)</p>
</blockquote>
<p>It appears the table, userelements is missing?</p>
<p>How do I move forward?  THANK YOU!</p>

CC BY-SA 4.0
2023-04-12T20:02:00.240Z
May be best to reach out to the plugin developer (Craft Social I presume?)
James Smith
<craft3><manual-updates>
Upgrading from Craft 3.7.1 to 3.7.19
# Upgrading from Craft 3.7.1 to 3.7.19

(Asked by: username_0 on 2023-04-12)

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!

**Tags:** craft3, manual-updates
> **Comments:**
> **username_1**: May be best to reach out to the plugin developer (Craft Social I presume?)  

---

## 2 answers

### Answer by username_0 on 2023-04-14. Score: 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!


---

### Answer by username_2 on 2023-04-12. Score: 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/

> **Comments:**
> **username_0**: Thank you! I am really grateful for your response. It's weird that it didn't show up in composer update --dry-run.  
> **username_2**: Probably because composer's `--dry-run` doesn't know about Craft's migrations, which is where the error is happening.  

---

