Project

General

Profile

Actions

Defect #5723

closed

Error db:migrate with rails=2.3.8

Added by Mike Stupalov over 14 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Start date:
2010-06-22
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

I use environment:

Ruby version              1.8.7 (amd64-freebsd8)
RubyGems version          1.3.7
Rack version              1.1
Rails version             2.3.8
Active Record version     2.3.8
Active Resource version   2.3.8
Action Mailer version     2.3.8
Active Support version    2.3.8
Application root          /usr/local/www/redmine
Environment               production
Database adapter          postgresql
Database schema version   20100323105501

At initial installation of base (db:migrate) there was an error:

$ RAILS_ENV=production rake db:migrate
(in /usr/local/www/redmine)
...(skipped lines)
==  CreateWikis: migrating ====================================================
-- create_table(:wikis)
NOTICE:  CREATE TABLE will create implicit sequence "wikis_id_seq" for serial column "wikis.id" 
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "wikis_pkey" for table "wikis" 
   -> 0.0137s
-- add_index(:wikis, :project_id, {:name=>:wikis_project_id})
rake aborted!
An error has occurred, this and all later migrations canceled:

undefined method `length' for :wikis_project_id:Symbol

(See full trace by running task with --trace)

I have viewed a code of creation of base and have found syntax errors in add_index and remove_index. Options ":name" are specified with a colon, and there should be commas:

-    add_index :wikis, :project_id, :name => :wikis_project_id
+    add_index :wikis, :project_id, :name => "wikis_project_id" 

(As it is written in documentation Class ActiveRecord::Migration)


Files

db_migrate.patch (11.6 KB) db_migrate.patch DB migrate patch for rails 2.3.8 Mike Stupalov, 2010-06-22 13:40
0001-Make-sure-name-in-enclosed-in-quotation-marks.patch (13.6 KB) 0001-Make-sure-name-in-enclosed-in-quotation-marks.patch Torgny Nyblom, 2010-12-27 12:32

Related issues

Has duplicate Redmine - Defect #6051: undefined method `length' for :changesets_repos_scmid:SymbolClosed2010-08-06

Actions
Actions #1

Updated by Felix Schäfer over 14 years ago

Rails 2.3.8 is unsupported as of zet, keeping open for the time we do though.

Actions #2

Updated by Torgny Nyblom almost 14 years ago

Updated patch that covers the destruction as well as the creation of the db.

Actions #3

Updated by Etienne Massip about 13 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid
Actions

Also available in: Atom PDF