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

SQL errors when applying project config after switching git branches #546

Open
low opened this issue Dec 13, 2023 · 0 comments
Open

SQL errors when applying project config after switching git branches #546

low opened this issue Dec 13, 2023 · 0 comments

Comments

@low
Copy link

low commented Dec 13, 2023

Describe the bug

Working on a project with a team, where each member is adding Matrix block types and adding ST fields to them. This results in a mismatch of each developer's list of rows in the matrixblocktypes table, and thus in different stc_ID_HANDLE tables. This can cause issues when trying to sync up the CMS after switching branches, for example:

Applying changes from your project config files ...
- updating superTableBlockTypes.2565261f-97c4-4834-b550-deabb125609b ... 
  - updating matrixBlockTypes ... done
error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbname.stc_64_ctabuttons' doesn't exist
The SQL being executed was: ALTER TABLE `stc_64_ctabuttons` ADD `field_style_abummlrk` varchar(9)

The ID 64 here refers to a different or non-existent Matrix Block Types on my machine, rather than the one the other dev was using.

If instead of the ID, we'd use the first chunk of the UID (which remains unchanged across different envs), the issue would be solved: https://github.com/verbb/super-table/blob/craft-4/src/services/Service.php#L670

This issue looks to be related -- we also use the same ST field setup across different matrix block types.

Steps to reproduce

See above.

Craft CMS version

4.5.11

Plugin version

3.0.12

Multi-site?

Yes

Additional context

No response

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

No branches or pull requests

1 participant