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

[3.0] Fix an issue with mediumtext type #8127

Merged

Conversation

dragomano
Copy link
Contributor

Fixes #8126

Comment on lines 1352 to 1353
'mediumtext' => 'text',
'largetext' => 'text',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem correct to me. Why would we want to change MEDIUMTEXT and LARGETEXT data types to regular TEXT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. This means something changed somewhere, because in Alpha 1 database.php worked as expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now a query like this is generated:

CREATE TABLE `smf_alpha`.smf_lp_pages ( `page_id` smallint(5) unsigned auto_increment, `alias` varchar(255) NOT NULL , `description` varchar(255) , `content` mediumtext(0) NOT NULL , `type` varchar(10) NOT NULL DEFAULT 'bbc', PRIMARY KEY (page_id), UNIQUE alias (alias(191))) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci

And it needs to be like this:

CREATE TABLE `smf_alpha`.smf_lp_pages ( `page_id` smallint(5) unsigned auto_increment, `alias` varchar(255) NOT NULL , `description` varchar(255) , `content` mediumtext NOT NULL , `type` varchar(10) NOT NULL DEFAULT 'bbc', PRIMARY KEY (page_id), UNIQUE alias (alias(191))) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type hinting issue is defaulting the size to 0 and it needs to be nullable so when null we don't pass a size.

@dragomano dragomano changed the title [3.0] Fix an issue with mediumtext/largetext type [3.0] Fix an issue with mediumtext type Mar 5, 2024
@Sesquipedalian Sesquipedalian merged commit a371bbf into SimpleMachines:release-3.0 Mar 8, 2024
6 checks passed
@dragomano dragomano deleted the mediumtext_largetext branch March 9, 2024 01:07
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.

[3.0]: Adding columns with type = 'mediumtext' does not work
3 participants