Ruby on Rails
Thursday, September 7, 2017
Hi, ime trying to get my head around how these interact as I acidentely deleted a migration and had not commited it to git.
The migration is 'up'. So I did some research and it seems if I just delete the migration from the schema_migrations (and make sure the corresponding database object does not exist) will fix it. So I had a look at scema_migrations table and this got me wondering how rails knows if the migration is up or down, there is not status attribute on the table.
-- The migration is 'up'. So I did some research and it seems if I just delete the migration from the schema_migrations (and make sure the corresponding database object does not exist) will fix it. So I had a look at scema_migrations table and this got me wondering how rails knows if the migration is up or down, there is not status attribute on the table.
So I did some more research and came across db/schema.rb, which rails used to work out if a migration is up or down. I looked in log/development.log to doble check what the migration was doing and found 'CREATE TABLE "create_report_upcoming_events" so I checked db/schema.rb and sure enough there is a reference to the view. This is not domething I want and it has not been put into production. So it seems if I just delete the record from the scema_migrations table things will still be inconsistent.
So do I delete the row from schema_migrations and the reference to the view in db/schema.rb or will just deleting the migration from scema_migrations sufice?
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bebc323e-f979-4598-b7eb-d155b2b9904e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment