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

MySQL migration error with default JSON data #3141

Open
Floppy opened this issue Nov 12, 2024 · 4 comments
Open

MySQL migration error with default JSON data #3141

Floppy opened this issue Nov 12, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Floppy
Copy link
Collaborator

Floppy commented Nov 12, 2024

::Error: BLOB, TEXT, GEOMETRY or JSON column 'pagination_settings' can't have a default value (Mysql2::Error)

See original report in #3138.

@Floppy
Copy link
Collaborator Author

Floppy commented Nov 12, 2024

@NeoMod can I ask which version of MySQL/MariaDB you're running, please?

@Floppy
Copy link
Collaborator Author

Floppy commented Nov 12, 2024

This seems to be because MySQL 8+ wants the default as an expression, not a literal. But surely Rails should be handling that for us? See https://dev.mysql.com/doc/refman/8.0/en/data-type-defaults.html

@Floppy
Copy link
Collaborator Author

Floppy commented Nov 12, 2024

Worst case is we don't set a default for MySQL. The code will use default values from elsewhere anyway, so it probably won't matter at all.

@Floppy
Copy link
Collaborator Author

Floppy commented Nov 18, 2024

This works OK with MariaDB 10, just tested it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant