Closed danielmklein closed 2 years ago
it looks like it tries to delete a file with a different migration version number than the original
That's interesting. I wonder how rails destroy model X
works 🤔
I will push a PR for this if I can figure it out
That would be awesome! I'd suggest starting with a test here: https://github.com/palkan/logidze/blob/master/spec/generators/model_generator_spec.rb
As an update, I made a bit of progress here -- https://github.com/danielmklein/logidze/tree/fix/migration-revoke. I have the fix working when I run rails destroy logidze:model MyModel
manually now, but I haven't quite cracked why my test isn't working.
EDIT: Figured it out -- PR #206 is up!
Tell us about your environment
Ruby Version: 3.0.3
Rails Version: 6.1.4
PostgreSQL Version: 11.14
Logidze Version: 1.2.0
What did you do? / What did you expect to happen? / What actually happened?
Run the following (assuming
MyModel
is an existing model that does not have logidze yet):Rest assured, I am wading through the migration code and I will push a PR for this if I can figure it out, but I wanted to raise it here in case anyone else saw a quick fix! If I am going crazy and/or doing something wrong here, please let me know.