craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.29k stars 638 forks source link

[4.x]: Changing matrix field handle creates duplicate DB table when applying project config #16227

Open jmauzyk opened 4 days ago

jmauzyk commented 4 days ago

What happened?

Description

After changing the handle of an existing matrix field, deploying and applying the project config changes resulted in an unexpected database structure. Specifically:

Steps to reproduce

  1. Create a matrix field, deploy the project config changes, and apply them. This updates the database as expected.
  2. Change the matrix field's handle, deploy the project config changes, and apply them.

Expected behavior

The database table for the matrix field should be renamed from matrixcontent_oldhandle to matrixcontent_newhandle, preserving the existing columns for the matrix block fields.

Actual behavior

A new table, matrixcontent_newhandle, is created, but it does not include any columns for the matrix block fields. The matrixcontent_oldhandle table remains in the database, unmodified.

Craft CMS version

4.13.3

PHP version

8.2.4

Operating system and version

Linux 4.15.0-65-generic

Database type and version

PostgreSQL 14.7

Image driver and version

Imagick 3.7.0 (ImageMagick 6.9.7-4)

Installed plugins and versions

No response

i-just commented 3 days ago

Hi, thanks for reporting! I raised a PR for this.