Project

General

Profile

Bug #2264

Updated by The Foreman Bot over 6 years ago

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":http://stackoverflow.com/questions/7012812/schema-rb-index-different-from-individual-migration-index.

Back