Have you run these migrations in production yet, or is it just in development? 
Because you can back your way out of this manually, but if you aren't careful, 
you can end up with things out of synch between your code and your actual 
database. The migrations and the schema_migrations table are a kind of "git" 
for your database. Speaking of which, can't you recover the missing migration 
file from a previous git commit or branch?

Assuming you cannot, and you are willing to live on the edge (which would be a 
pretty redundant statement if you were not running git, you will admit):

Manually delete (through SQL) the view that this migration would have created, 
if it exists, in all databases.
Manually delete (through SQL) the row with the value '20170903000942' from the 
schema_migrations table.

Now it is as though that missing migration was never run and doesn't exist.

Walter

> On Sep 5, 2017, at 8:10 PM, Ben Edwards <[email protected]> wrote:
> 
> I accidentally deleted a migration file and its up.  I looked in the 
> development.log and it was to create  a view I don’t actually need.
> 
> database: eventpuddle_development
> 
>  Status   Migration ID    Migration Name
> --------------------------------------------------
>    up     20170901234251  Create venues
>    up     20170902001958  Create ref values
>    up     20170902005356  Create events
>    up     20170902010547  Create logs
>    up     20170902125827  Fix column name
>    up     20170902184156  Add events fk
>    up     20170902190440  Add null constraints
>    up     20170903000942  ********** NO FILE **********
>    up     20170903012041  Upcomming events
>    up     20170904191027  Devise create users
>    up     20170904215057  Add roles to users
> 
> So what should I do?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/d438d78f-4484-49ec-83f6-6933d2dfaad4%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/BC8B8CCD-65AE-4D95-8639-92CA0767CCB6%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to