Rails - Generating migration script from model

前端 未结 2 924
我寻月下人不归
我寻月下人不归 2021-02-20 18:40

I am learning rails, and I came across Migrations. It seems that everytime I want to edit a model, I would need to add a migration script, even though I am not yet in production

2条回答
  •  说谎
    说谎 (楼主)
    2021-02-20 19:06

    If your using rails 3+ you might want to consider DataMapper instead of ActiveRecord. It lets you define the data model in the model instead of multiple migration files. As I understand DataMapper lets you generate migrations from changes.

    This is a tried and trusted pattern often used in the wider ORM community.

提交回复
热议问题