Note that there are some explanatory texts on larger screens.

plurals
  1. PODeleted migration.rb file? Potential bug in rails?
    primarykey
    data
    text
    <p>I am not sure if this is a bug or if this actually removed a migration.rb file. I used generate to create the following migration:</p> <p><code>$ rails generate migration add_delta_to_submissions</code> </p> <pre><code> invoke active_record create db/migrate/20111020175649_add_delta_to_submissions.rb </code></pre> <p>I then realized that I neglected to include any columns, so I used the UP ARROW in the console and overwrote generate with destroy:</p> <p><code>$ rails destroy migration add_delta_to_submissions</code> </p> <pre><code> invoke active_record remove db/migrate/20111020175649_add_delta_to_submissions.rb </code></pre> <p>All good so far, now its time to run the migration with the column I need. Here is where the problem comes in - I used the UP ARROW again - but only once - and added my column info:</p> <p><code>$ rails destroy migration add_delta_to_submissions delta:integer</code> </p> <pre><code> invoke active_record remove migration.rb </code></pre> <p>I realize I should probably NOT be using the UP ARROW for commands as volatile as GENERATE and DESTROY (lesson learned!), but that command came back stating it REMOVED the migration.rb file. I didn't even know there was a migration.rb file - especially not one that could be removed so easily.</p> <p>For kicks, I decided to try and trick the command console by adding the letter x to the end of word migration - and received this message:</p> <p><code>$ rails destroy migrationx add_delta_to_submissions delta:integer</code> </p> <pre><code> Could not find generator migrationx. </code></pre> <p>So, I think there could be a bug with the rails destroy command. Once it realized there was no longer a add_delta_to_submissions.rb file, it just lopped that off and tacked on the .rb to the word migration (or any word after DESTROY). That seems a bit dangerous....</p> <p>Regardless of that - I am curious to know if I have somehow compromised my RAILS environment (rails 3.1, ruby 1.8.7) now that the migration.rb file has been removed. If so - what are my options for fixing that situation?</p> <p>Many thanks in advance...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload