开发者

Can ActiveRecord in Rails generate database schema

Hi Does anyone know if a model in Rails can be used to generate a database schema?

Thanks, Mark开发者_如何学Python


I believe you are looking for migrations in Rails: http://guides.rubyonrails.org/migrations.html

If you use the rails generators to create your models then your migrations are also generated for you and all you have to run is

rake db:migrate

in order to get your schema in the database

You can also refer to schema.rb to look at your current state of the schema

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜