Tag: activerecord jdbc

Rails架构创建问题

我正在使用Jruby和rails 2.2.2。 我的问题是我的迁移未正确写入数据库模式。 这是我的迁移: class CreateNotes ‘ENGINE=MyISAM’) do |t| t.string :title t.text :body t.timestamps end execute “alter table notes ADD FULLTEXT(title, body)” end 这是它在schema.rb中生成的内容 create_table “notes”, :force => true do |t| t.string “title” t.text “body” t.datetime “created_at” t.datetime “updated_at” end add_index “notes”, [“title”, “body”], :name => “title” 我有两个问题: 如何将’ENGINE=MyISAM’纳入架构? 为什么我的执行语句变成add_index “notes”, [“title”, “body”], :name => […]

在Rails DB中使用CamelCase而不是snake_case

我的数据库表和字段名称在CamelCase中。 是否可以将这些名称转换为snake_case? 使模型方法看起来很漂亮? 该应用程序是JRubyOnRails 3.0 / MSSQL DB / ActiveRecord-JDBC-adapter。