Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
db:schema:load vs rake db:migrate #184
Why use one over the other ? Only info I found was going against using db:schema:load as running it on a production server would simply wipe existing database data. (http://stackoverflow.com/a/5905958)
Is it only useful for projects with deleted old migrations ? Is it good practice to delete old migrations you know won't ever be needed again ?
@edorgeville Running it in production would indeed wipe the data, which indeed does what the quote implies:
If that is exactly what you want to do, which you sometimes wish to do locally to clean the slate, then db:schema:load will set up the database according to db/schema.rb instead of running all your migrations from db/migrate/, which may include migrations that represent needless work (eg, if a column changed name at some point and was later removed, you don't need to perform the name change, just the removal).