Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jmauzyk opened this issue Nov 27, 2024 · 1 comment
Assignees

Comments

@jmauzyk
Copy link

jmauzyk commented Nov 27, 2024

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:

  • A new matrixcontent table was created for the new handle, but it lacked columns for the matrix block fields
  • The matrixcontent table for the old handle remained in the database unchanged

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
Copy link
Contributor

i-just commented Nov 28, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants