I ran into a problem when I was working on two branches in a rails project, and each project has a migration to add a column. At that time, rake db:migrate:reset caused a problem, and I only relied on my schema.rb to correctly represent the state of my database. At some point, I ran into a problem when the column added by branch A got into the scheme of branch B. Since migrate:reset not an option, I resorted to manually editing the scheme file. I made this change, which basically removed the column from branch A, which I don't need in branch B. schema.rb.
The problem arose after I merged branch A into the master. When I tried to translate the B branch to master, I still had a commit in B to remove the column (which has now become relevant because it is in master) in the schema file. Git saw no conflict for this and automatically merged it. At the end of my call forwarding, I found that my circuit does not match what I have with the master.
My fix is ββto edit the schema file again and manually add the previously deleted column back to the schema file. My question is: is this considered unconventional? dangerous? Hacky?
Now it includes one column, but if it involves deleting / adding multiple columns, then (dangerous?) Solution can lead to more problems and db / schema.rb mismatch.
denniss
source share