horizon
horizon copied to clipboard
Add hz schema save --force option to enable overwriting
Starting state 1
$ tree
.
├── .hz
│ ├── config.toml
│ ├── schema.toml
│ └── secrets.toml
Option 1:
hz schema save
$ tree
.
├── .hz
│ ├── config.toml
│ ├── schema.toml
│ ├── schema.toml.2016-08-03T19:55:28.876Z
│ └── secrets.toml
Option 2:
hz schema save --force
$ tree
.
├── .hz
│ ├── config.toml
│ ├── schema.toml # overwritten
│ └── secrets.toml
This should also work with hz schema save --out-file
which will require --force
before overwriting the specified output toml
file and will error out without it specified.
How about --overwrite
instead of --force
? --force
can mean anything.
... on the other hand, I think we have --force
for schema apply
though?
I'm not sure the behavior for option 2 is good. I think maybe it should let you specify a file to save to, and error out if there's a conflict. Otherwise people will do things like hz schema save; hz cloud deploy
and deploy the old schema rather than the one they just dumped.
I believe the idea is to rename the *old* file, so schema.toml is always the most recent one. At least that's what I had in mind. I think the old file should be called schema.toml.old.[date] or something like that though (i.e. Include the word old or bak in its name).
I believe the idea is to rename the old file, so schema.toml is always the most recent one. At least that's what I had in mind.
This is correct.
I think the old file should be called schema.toml.old.[date] or something like that though (i.e. Include the word old or bak in its name).
I think this is a good addition for explicit clarity.