edgedb-cli icon indicating copy to clipboard operation
edgedb-cli copied to clipboard

Hide revision hashes from user-facing messages

Open colinhacks opened this issue 2 years ago • 2 comments

Before

$ edgedb migration create
Created dbschema/migrations/00003.edgeql, id: m1yh4d3dmfghpbidcnh3jf3flusvznborapmb54blv5mloiqzuzsia
edgedb migrate
Applied m1yh4d3dmfghpbidcnh3jf3flusvznborapmb54blv5mloiqzuzsia (00003.edgeql)

After

$ edgedb migration create
Created dbschema/migrations/00003.edgeql.
$ edgedb migrate
Applied dbshcema/migrations/00003.edgeql.

colinhacks avatar Aug 27 '22 02:08 colinhacks

I find hashes informative and debuggable. E.g. when some migration applied on the production and then file was mistakenly changed by rebasing, it's easier to find out that different revision was applied to production by looking at the log.

We discussed accepting prefixes of the migrations instead of full-length ones. But that requires some thinking of how short they should be and when to make them more long and what to do with conflicting prefixes. The fact that we have two sources of the revisions (files and database) checking for conflicts may severely complicate some of the workflows, I think.

tailhook avatar Aug 29 '22 15:08 tailhook

Note to myself: actually --to-revision support with unique prefix is implemented. So I think we can get away with something like 14-char prefixes (i.e. 12 chars of hash + "m1"), to get reasonably-unique identifiers.

tailhook avatar Sep 20 '22 09:09 tailhook