如何创建SQL模式模式、SQL

由网友(旧梦残颜)分享简介:按http://edgeguides.rubyonrails.org/configuring.html和this帖子我有这样的application.rb中As per http://edgeguides.rubyonrails.org/configuring.html and this post I have th...

按http://edgeguides.rubyonrails.org/configuring.html和this帖子我有这样的application.rb中

As per http://edgeguides.rubyonrails.org/configuring.html and this post I have this in application.rb

config.active_record.schema_format = :sql

然而,它仍然创造DB / schema.rb(即使我删除),更重要的是它不是在创建SQL模式,当我运行耙分贝:迁移。任何人都知道我在做什么错了?我对Rails的3.1 pre。

However, it's still creating db/schema.rb (even after I delete it) and more importantly it's not creating the schema in sql when I run "rake db:migrate". Anyone know what I'm doing wrong? I'm on Rails 3.1 pre.

推荐答案

那么,这可能是一个错误轨道,但你总是可以生成你的数据库结构如下:

Well, this could be a rails bug, but you can always generate your db structure with this:

rake db:structure:dump

这将会产生一个#{Rails.env}的.sql文件,你在你的SQL数据库结构。

This is going to generate an "#{Rails.env}.sql" file for you with your database structure in SQL.

阅读全文

相关推荐

最新文章