Project

General

Profile

Actions

Bug #2264

closed

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

Added by Dominic Cleal about 11 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Database
Target version:
Difficulty:
Triaged:
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 1 (0 open1 closed)

Has duplicate Foreman - Bug #1614: SQL index on sources.value columnDuplicate05/10/2012Actions
Actions #1

Updated by Dominic Cleal about 11 years ago

  • Status changed from Assigned to Ready For Testing
Actions #2

Updated by Ohad Levy about 11 years ago

  • Target version set to 1.2.0
Actions #3

Updated by Dominic Cleal about 11 years ago

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

Updated by Dominic Cleal about 8 years ago

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

Updated by The Foreman Bot about 6 years ago

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

Updated by Anonymous about 6 years ago

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

Also available in: Atom PDF