From fd50304f5ff5ffbc985695eaa73c1bc56b1ca061 Mon Sep 17 00:00:00 2001 From: Xiao Yijun Date: Mon, 17 Oct 2022 23:18:28 +0800 Subject: [PATCH] fix(cli): `chooseAlterationsByVersion` should contain the last `next` version alteration script (#2175) --- packages/cli/src/commands/database/alteration/index.test.ts | 2 +- packages/cli/src/commands/database/alteration/version.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/commands/database/alteration/index.test.ts b/packages/cli/src/commands/database/alteration/index.test.ts index 5584dcf83..4a2cc37bc 100644 --- a/packages/cli/src/commands/database/alteration/index.test.ts +++ b/packages/cli/src/commands/database/alteration/index.test.ts @@ -75,7 +75,7 @@ describe('chooseAlterationsByVersion()', () => { ), expect(chooseAlterationsByVersion(files, 'v1.1.0')).resolves.toEqual(files.slice(0, 8)), expect(chooseAlterationsByVersion(files, 'v1.2.0')).resolves.toEqual(files.slice(0, 9)), - expect(chooseAlterationsByVersion(files, 'next')).resolves.toEqual(files.slice(0, 11)), + expect(chooseAlterationsByVersion(files, 'next')).resolves.toEqual(files.slice(0, 12)), ]); }); }); diff --git a/packages/cli/src/commands/database/alteration/version.ts b/packages/cli/src/commands/database/alteration/version.ts index 21605a8ee..43d4695c5 100644 --- a/packages/cli/src/commands/database/alteration/version.ts +++ b/packages/cli/src/commands/database/alteration/version.ts @@ -32,7 +32,7 @@ export const chooseAlterationsByVersion = async ( log.info(`Deploy target ${chalk.green(nextTag)}`); - return alterations.slice(0, endIndex); + return alterations.slice(0, endIndex + 1); } const versions = alterations