sqitchers / sqitch

Sensible database change management
https://sqitch.org
MIT License
2.78k stars 215 forks source link

sqitch init called on already initialized directory silenlty fails #504

Open strk opened 4 years ago

strk commented 4 years ago

See this session:

$ sqitch init tutorial --engine mysql && grep 'engine =' sqitch.conf
Created sqitch.conf
        engine = mysql
$ sqitch init tutorial --engine pg && grep 'engine =' sqitch.conf
        engine = mysql

I would expect the second run to fail instead.

Note that changing the name does indeed fail:

$ sqitch init test --engine pg && grep 'engine =' sqitch.conf
Cannot initialize because project "tutorial" already initialized in sqitch.plan
strk commented 4 years ago

The above happens with sqitch (App::Sqitch) 0.9996

theory commented 4 years ago

Yeah, it sees that the file exists already so don't create it. Could read it in and see if there are any disagreements, but it's quite easily fixed by running sqitch config core.engine pg.

strk commented 4 years ago

Even NOT checking would be ok, just fail mentioning the directory is already initialized and maybe HINT about using sqitch config