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

fix error when altering column to boolean in pgsql #14795

Merged
merged 4 commits into from
Apr 12, 2024

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Apr 11, 2024

Description

When changing a field type from any to Lightswitch, the field’s column in the content table is altered to type boolean.

This worked as expected in MySQL, but in PostgreSQL, Datatype mismatch: 7 ERROR: column "<field_name>" cannot be cast automatically to type boolean error was thrown and caught, and the logic then attempted to create a column with the same name as one we’re trying to change.

I’ve altered the SQL that is being executed for PostgreSQL and the boolean type combination.

Related issues

#14792

@i-just i-just requested a review from brandonkelly April 11, 2024 13:40
@brandonkelly brandonkelly merged commit 2ca800f into 4.x Apr 12, 2024
3 checks passed
@brandonkelly brandonkelly deleted the bugfix/14792-pgsql-alter-column-to-boolean branch April 12, 2024 21:16
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

Successfully merging this pull request may close these issues.

2 participants