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

Change MySQL bool mapping from TINYINT(1) to TINYINT #6569

Open
wants to merge 1 commit into
base: 4.2.x
Choose a base branch
from

Conversation

paranoiq
Copy link

@paranoiq paranoiq commented Oct 22, 2024

Since 8.0 MySQL throws whis warning "1681 [HY000] Integer display width is deprecated and will be removed in a future release." when integer column with display width is created

This change is backwards compatible and can be merged into all active branches (does not trigger column type update migration)

- since 8.0 Mysql throws "1681 [HY000] Integer display width is deprecated and will be removed in a future release." when integer column with display with is created
- this change is backwards compatible (does not trigger column type update migration)
@derrabus
Copy link
Member

Would this break our introspection of boolean columns?

You've also changed the behavior for MariaDB. Was that intended?

Copy link

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
If you want to continue working on it, please leave a comment.

@Rixafy
Copy link

Rixafy commented Jan 31, 2025

This solves the problem when someone wants to have custom TINYINT, now it's not possible since this always triggers migration, as mentioned in related issue - because it compares TINYINT(1) with custom defined type that doesn't have (1) in it.

Would this break our introspection of boolean columns?

Change does not trigger migration and it's compatible with all MySQL/MariaDB versions, but the definition in newly generated migrations (when adding columns) will be different, it will be declared as TINYINT instead of TINYINT(1), and default value in MySQL/MariaDB is TINYINT(3), but it has no effect on column size, only on width - how many characters to display, for some systems that read those metadata.

You've also changed the behavior for MariaDB. Was that intended?

Since we haven't heard back from the author, I suggest that it's good for all MySQL-based DB, because it makes definition of custom TINYINT type easier.

@github-actions github-actions bot removed the Stale label Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants