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

[4.x] Remove schema check on import users command #8909

Merged
merged 3 commits into from
Nov 3, 2023

Conversation

ryanmitchell
Copy link
Contributor

It seems MySQL 8 returns CHAR, instead of string for the column type, so we should allow that.
(Maybe its worth removing the column type check altogether?)

Also updated it to not assume id, but use $model->getKey()

Fixes: #8907

@ryanmitchell ryanmitchell changed the title CHAR is a valid column type on the eloquent user import column type [4.x] CHAR is a valid column type on the eloquent user import column type Nov 1, 2023
@jasonvarga
Copy link
Member

Yeah maybe we just get rid of it. The SQL error kinda explains it if you run into it naturally.

SQLSTATE[01000]: Warning: 1265 Data truncated for column 'id' at row 1 (Connection: mysql, SQL: insert into `users` (`email`, `preferences`, `name`, `id`, `updated_at`, `created_at`) values ([email protected], [], John Smith, 2d2e1188-a217-4697-8a0c-0cd61b1e5465, 2023-11-03 14:41:35, 2023-11-03 14:41:35))

@jasonvarga jasonvarga changed the title [4.x] CHAR is a valid column type on the eloquent user import column type [4.x] Remove schema check on import users command Nov 3, 2023
@jasonvarga jasonvarga merged commit 9a63a3b into statamic:4.x Nov 3, 2023
19 checks passed
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.

Importing users into Eloquent fails due to wrong column type checked
2 participants