开发者

Can ActiveRecord in Rails generate database schema

开发者 https://www.devze.com 2023-01-24 19:32 出处:网络
Hi Does anyone know if a model in Rails can be used to generate a database schema? Thanks, Mark开发者_如何学PythonI believe you are looking for migrations in Rails: http://guides.rubyonrails.org/migr

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

精彩评论

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