Project

General

Profile

Bug #2264

schema.rb invalid for MySQL, fails creating index on sources.value TEXT column

Added by Dominic Cleal about 6 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Database
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

On MySQL, the sources table gets created with a full text index in the 20101018120603_create_sources.rb migration:

CreateSources: migrating ==================================================
-- create_table(:sources)
> 0.2536s
-
execute("ALTER TABLE sources ENGINE = MYISAM")
> 0.1248s
-
execute("ALTER TABLE sources ADD FULLTEXT (value)")
-> 0.0606s
CreateSources: migrated (0.4396s) =========================================

db/schema.rb gets written out as:

create_table "sources", :force => true do |t|
t.text "value"
end
add_index "sources", ["value"], :name => "value"

However when this is run as part of loading test fixtures, it fails as it doesn't create a full text index:

CREATE TABLE `sources` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `value` text) ENGINE=InnoDB
CREATE INDEX `value` ON `sources` (`value`)^[[0m
Mysql::Error: BLOB/TEXT column 'value' used in key specification without a key length: CREATE INDEX `value` ON `sources` (`value`)

I'd suggest the same fix used for #2126 is applied to sources, or change it to use a SQL schema.


Related issues

Has duplicate Foreman - Bug #1614: SQL index on sources.value columnDuplicate2012-05-10

Associated revisions

Revision bf38fd07 (diff)
Added by Dominic Cleal about 6 years ago

fixes #2264 - replace fulltext sources.value index with digest

History

#1 Updated by Dominic Cleal about 6 years ago

  • Status changed from Assigned to Ready For Testing

#2 Updated by Ohad Levy about 6 years ago

  • Target version set to 1.2.0

#3 Updated by Dominic Cleal about 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal about 3 years ago

  • Has duplicate Bug #1614: SQL index on sources.value column added

#5 Updated by The Foreman Bot over 1 year ago

  • Description updated (diff)
  • Pull request https://github.com/theforeman/foreman/pull/5153 added

#6 Updated by Michael Moll over 1 year ago

  • Pull request deleted (https://github.com/theforeman/foreman/pull/5153)

Also available in: Atom PDF