0

运行迁移文件时:

 def self.up
   create_table (:project_paths,:id=>false) do |t|
      t.integer :project_id
      t.integer :path_id
   end
 end

我收到了这个错误:

语法错误,意外 ',',期待 ')' create_table (:project_paths,:id=>false) do |t|

4

1 回答 1

1

只需删除create_table. 像这样

def self.up
  create_table(:project_paths, :id => false) do |t|
     t.integer :project_id
     t.integer :path_id
  end
end
于 2012-09-18T08:06:01.527 回答