1

I am building a web application using Padrino and sequel as ORM. I mistyped Padrino migration command for model generation, and as you can see in the screenshot, the wrong command ended up generating a nameless migration file db/migrate/041_g.rb. I then wanted to delete this wrong file using by using the same mistyped command with -d at the end of the command for deleting the generated file, I surprisingly ended up with a random deletion of one of my project migration files that has nothing to do with the command i just ran

nxn@debian:~/PRODUCTION/tubes$ padrino g migration g model AccountAthorizedPayment uuid:string account_id:int payment_provider_id:int authorisation_status:string created_at:datetime updated_at:timestamp
   apply  orms/sequel
  create  db/migrate/041_g.rb

nxn@debian:~/PRODUCTION/tubes$ padrino g migration g model AccountAthorizedPayment uuid:string account_id:int payment_provider_id:int authorisation_status:string created_at:datetime updated_at:timestamp -d
   apply  orms/sequel
  remove  db/migrate/008_add_channel_profile_image_to_order.rb
  nxn@debian:~/PRODUCTION/streamtubes$ 

Screenshot of Padrino commands

Anyone ever faced this issue? any explanation about this random behavior?

  • 2
    Padrino CLI doesn't support multiple generators executed in one command, so your commands themselves are kinda "undefined behavior" - they are being treated as just a migration (with a name `g`) generation/deletion. The 2nd one is weird indeed and, if reproducible, might mean some bug in Padrino generators machinery - but it is hard to say for sure without debugging. – Konstantin Strukov Feb 08 '22 at 09:30

0 Answers0