Actions
Defect #5723
closedError db:migrate with rails=2.3.8
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
Related issues
Actions