Skip to content

magento/magento2#38798: Cannot change column type in some cases #39932

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

Conversation

KrasnoshchokBohdan
Copy link
Contributor

@KrasnoshchokBohdan KrasnoshchokBohdan commented May 23, 2025

  • changed 'note' column type from varchar to text, removed length attribute

Description (*)

Error happens here
vendor/magento/framework/Config/Reader/Filesystem.php 186

As the author of the issue noticed, an interesting solution is proposed in
#26155 (comment)

but for now I'll just stick to changing the type, if there are other suggestions I'll be happy to consider them
https://developer.adobe.com/commerce/php/development/components/declarative-schema/configuration/#change-the-column-type

Related Pull Requests

26160

Fixed Issues (if relevant)

  1. Fixes magento/magento2#38798

Manual testing scenarios (*)

1.create new module, or use existing one from app/code/
2.add this snippet to db_schema.xml

<table name="eav_attribute"> <column xsi:type="text" name="note" nullable="true" comment="Note"/> </table>

3.use bin/magento setup:upgrade command
4.see error "Element 'column', attribute 'length': The attribute 'length' is not allowed."

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Sorry, something went wrong.

- changed 'note' column type from varchar to text, removed length attribute
Copy link

m2-assistant bot commented May 23, 2025

Hi @KrasnoshchokBohdan. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@KrasnoshchokBohdan
Copy link
Contributor Author

@magento run all tests

@KrasnoshchokBohdan
Copy link
Contributor Author

@magento run all tests

@engcom-Hotel engcom-Hotel added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label May 27, 2025
@github-project-automation github-project-automation bot moved this to Pending Review in Pull Requests Dashboard May 27, 2025
@sidolov sidolov added Partner: Perspective partners-contribution Pull Request is created by Magento Partner labels May 29, 2025
@engcom-Hotel
Copy link
Contributor

@magento run all tests

@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Pending Review to Ready for Testing in Pull Requests Dashboard Jul 11, 2025
@engcom-Bravo engcom-Bravo added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Jul 14, 2025
@engcom-Charlie engcom-Charlie added the Project: Community Picked PRs upvoted by the community label Jul 14, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this to Ready for Testing in Community Dashboard Jul 14, 2025
@engcom-Dash engcom-Dash self-assigned this Jul 14, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Ready for Testing to Testing in Progress in Community Dashboard Jul 14, 2025
@engcom-Dash
Copy link
Contributor

@magento run all tests

@engcom-Dash
Copy link
Contributor

Hello @KrasnoshchokBohdan,

We have tried to reproduce the issue on 2.4-develop branch as per the description given in the PR but unable to do so.

  1. Created custom module with db_schema.xml.

    image
  2. Ran bin/magento setup:upgrade command

  3. The setup:upgrade command ran successfully without throwing any error. Also the type got reflected in DB successfully.

  4. Please find below screenshots.

image Screenshot 2025-07-15 at 3 20 11 PM

@KrasnoshchokBohdan could you please take a look once and let me know if I am missing something here.

Thanks!

@KrasnoshchokBohdan
Copy link
Contributor Author

@engcom-Dash Hi!
cant reproduce it on 2.4-develop, but I can reproduce it on clean 2.4.8
image

image

and, I see reason just to change column type like in #26160

@engcom-Dash
Copy link
Contributor

Hi @KrasnoshchokBohdan ,

Thank you for your contribution and for raising this PR.

We attempted to reproduce the reported behaviour on both the 2.4-develop and 2.4.8 versions across two different systems, but were unable to replicate the issue in either environment.

Additionally, we would like to clarify that our current focus is solely on the 2.4-develop magento2 repository. After internal discussion regarding this PR, we have decided to close it as the issue does not appear to be reproducible.

Screenshot 2025-07-17 at 2 45 55 PM Screenshot 2025-07-17 at 2 48 08 PM

Thank you again for your time and understanding.

CC: @engcom-Charlie @engcom-Hotel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Partner: Perspective partners-contribution Pull Request is created by Magento Partner Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: pending review Progress: testing in progress Project: Community Picked PRs upvoted by the community Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants