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: Don't auto-generate indexes for Text field types (fixes #7900) #7945

Merged
merged 1 commit into from
Apr 9, 2018

Conversation

kinglozzer
Copy link
Member

@kinglozzer kinglozzer commented Mar 20, 2018

if (
$this->hasOwnTableDatabaseField($column)
&& !array_key_exists($column, $indexes)
&& $fieldType !== 'Text' && !is_subclass_of($fieldType, 'Text')
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer a less hard-coded approach here, where we can set a config list of blacklisted index types?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah sure. Do you think DataObject makes sense, or should it be a setting like DBField.auto_indexable and then set private static $auto_indexable = false; on Text?

Copy link
Contributor

Choose a reason for hiding this comment

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

oooh, I like the latter idea 👍

@kinglozzer kinglozzer force-pushed the indexual-healing branch 3 times, most recently from ba8e47f to ce3751d Compare March 29, 2018 15:57
@kinglozzer
Copy link
Member Author

Ping @dhensby

@@ -3421,7 +3421,15 @@ public function databaseIndexes() {
continue;
}

if ($this->hasOwnTableDatabaseField($column) && !array_key_exists($column, $indexes)) {
list($fieldType) = Object::parse_class_spec($this->db($column));
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs to be SS_Object

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@dhensby
Copy link
Contributor

dhensby commented Apr 9, 2018

merge on green

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.

None yet

3 participants