Skip to content

[5.x]: Restoring variants does not work #4065

@boboldehampsink

Description

@boboldehampsink

What happened?

Description

PDOException: SQLSTATE[42703]: Undefined column: 7 ERROR:  column "sku" of relation "commerce_variants" does not exist
LINE 1: UPDATE "commerce_variants" SET "sku"=$1, "dateUpdated"=$2 WH...
                                       ^
  File "/index.php", line 19
    $app->run();
...
(15 additional frame(s) were not displayed)

yii\db\Exception: SQLSTATE[42703]: Undefined column: 7 ERROR:  column "sku" of relation "commerce_variants" does not exist
LINE 1: UPDATE "commerce_variants" SET "sku"=$1, "dateUpdated"=$2 WH...
                                       ^
The SQL being executed was: UPDATE "commerce_variants" SET "sku"='10762-1', "dateUpdated"='2025-06-28 11:59:29' WHERE "id"=97027
  File "/index.php", line 19
    $app->run();

Steps to reproduce

  1. Delete a variant
  2. Restore it

Craft CMS version

5.7.11

Craft Commerce version

5.4

PHP version

8.3

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions