Generate a migration file from schema.rb

后端 未结 2 1108
温柔的废话
温柔的废话 2021-02-01 15:17

I\'m looking to generate a migration file from the schema.rb. is it possible?

I have many migration files at the moment and would like to combine everything into one ma

2条回答
  •  不思量自难忘°
    2021-02-01 16:11

    There's no need to do this. For new installations you should be running rake db:schema:load, not rake db:migrate, this will load the schema into the database, which is faster than running all the migrations.

    You should never delete migrations, and certainly not combine them. As for accidentally deleting one, you should be using a version control system, such as Git.

提交回复
热议问题