mina icon indicating copy to clipboard operation
mina copied to clipboard

Mina setup and migrations: Files /home/base/rails/current/db/migrate/xxx.rb and ./db/migrate/xxx.rb differ

Open jmuheim opened this issue 9 years ago • 6 comments

I followed the guide in https://github.com/mina-deploy/mina/blob/master/docs/getting_started.md step by step.

I run mina setup --verbose, and everything seems fine.

I then run mina deploy --verbose, and after installing the gems successfully, I get this:

       Files /home/base/rails/current/db/migrate/20131224105939_devise_create_users.rb and ./db/migrate/20131224105939_devise_create_users.rb differ
       Files /home/base/rails/current/db/migrate/20140228115711_rolify_create_roles.rb and ./db/migrate/20140228115711_rolify_create_roles.rb differ

No idea what this means and whether I should do something. Is this related to mina anyway?

jmuheim avatar Jan 05 '17 11:01 jmuheim

Also during the migrations, I get some of them:

   $ RAILS_ENV="production" bundle exec rake db:migrate
   == 20161212151729 ChangeVersionsObjectToMediumText: migrating =================
   -- change_column(:versions, :object, :text, {:limit=>16777215})
      -> 0.4599s
   == 20161212151729 ChangeVersionsObjectToMediumText: migrated (0.4601s) ========
   
   Files /home/base/rails/current/vendor/assets/javascripts/jasny-bootstrap.js and ./vendor/assets/javascripts/jasny-bootstrap.js differ

jmuheim avatar Jan 05 '17 11:01 jmuheim

@jmuheim I'm running into the same "files differ" issue. If I skip the migration, the assets precompile step does the same thing.

What did you do to resolve this? I've deployed many sites with Mina before and have never gotten this. Has to be something basic, but I can't figure it out.

Thanks!

dparfrey avatar Sep 27 '17 15:09 dparfrey

In the meantime I felt like this is the normal behaviour: mina detects changes in asset files and triggers recompile on the server, or it detects changes in migration files and trigger migration on the server.

Am I wrong? Is this something suspicious?

jmuheim avatar Sep 28 '17 12:09 jmuheim

The problem is, it's detecting changes between my local migration files and the cloned GitHub version, and there aren't any changes. The result is to stop the deploy and not even try to run the migration (or precompile the assets). It's part of the mina script, and I agree it should be there, but don't know why it's malfunctioning for me. It's just a diff!

I've discovered some other strange behavior on my server, too, so the mina issues are likely caused by whatever else is going on. I'll post again when I figure it out (for posterity).

Thanks for replying!

dparfrey avatar Sep 28 '17 12:09 dparfrey

Good luck! I learned a new word today, "posterity", and I'm happy that this ticket got a bit more "posterious" (is this a real word, haha?!) thanks to this conversation. 😅

jmuheim avatar Sep 28 '17 13:09 jmuheim

This took longer to figure out than I ever dreamed! Oddly enough, my secrets.yml file was missing the # on the first line (bad copy/paste from another file).

I have no idea why that generated the errors it did. I figured it out after trying to run the migration on the server, which generated a different, a bit more helpful, error.

Hope this helps someone else!

dparfrey avatar Oct 07 '17 18:10 dparfrey