
这适用于MySQL,SQLite3和Postgres:
ActiveRecord::base.connection.tables.each do |table| puts ActiveRecord::base.connection.indexes(table).inspectend
但是我认为它只能为您专门创建的索引。
另外,要找出正在使用的适配器:
ActiveRecord::base.connection.class
欢迎分享,转载请注明来源:内存溢出

这适用于MySQL,SQLite3和Postgres:
ActiveRecord::base.connection.tables.each do |table| puts ActiveRecord::base.connection.indexes(table).inspectend
但是我认为它只能为您专门创建的索引。
另外,要找出正在使用的适配器:
ActiveRecord::base.connection.class
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)