From c492058a0c70d05347dd8dc4513a0d7cb033a3e8 Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Mon, 17 Oct 2022 23:36:16 +0800 Subject: [PATCH] refactor(cli): supports `latest` version for db alteration (#2177) --- packages/cli/src/commands/database/alteration/version.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/database/alteration/version.ts b/packages/cli/src/commands/database/alteration/version.ts index 43d4695c5..befde14d0 100644 --- a/packages/cli/src/commands/database/alteration/version.ts +++ b/packages/cli/src/commands/database/alteration/version.ts @@ -42,7 +42,9 @@ export const chooseAlterationsByVersion = async ( .filter((version, index, self) => index === self.findIndex((another) => eq(version, another))) .slice() .sort((i, j) => compare(j, i)); - const initialSemVersion = conditional(initialVersion && new SemVer(initialVersion)); + const initialSemVersion = conditional( + initialVersion && initialVersion !== latestTag && new SemVer(initialVersion) + ); if (!versions[0]) { return [];