如何将用 Ruby 编写的 MySQL 查询转换为 SQL?
是这样的:
create_table "academic_details", :force => true do |t|
t.integer "registration_id"
t.datetime "created_at"
t.datetime "updated_at"
end
我想要这样的东西:
CREATE TABLE IF NOT EXISTS `academic_details` (
`registration_id` int(11) NOT NULL AUTO_INCREMENT,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
最佳答案
运行rake db:structure:dump
,所有的表定义都会在db/structure.sql中生成
关于mysql - 如何将用 Ruby 编写的 MySQL 查询转换为 SQL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21552242/