diff --git a/.changeset/lucky-tigers-peel.md b/.changeset/lucky-tigers-peel.md new file mode 100644 index 000000000..9d6079527 --- /dev/null +++ b/.changeset/lucky-tigers-peel.md @@ -0,0 +1,5 @@ +--- +'@xata.io/cli': patch +--- + +Fix overriding client version to latest with Postgres branches if next is already a dependency diff --git a/cli/src/commands/init/index.ts b/cli/src/commands/init/index.ts index 74b2788f4..e17ef74af 100644 --- a/cli/src/commands/init/index.ts +++ b/cli/src/commands/init/index.ts @@ -382,7 +382,7 @@ export default class Init extends BaseCommand { async installSdk(packageManager: PackageManager, branchDetails: Schemas.DBBranch) { if (isBranchPgRollEnabled(branchDetails)) { const sdkVersion = await this.getSdkVersion(); - if (!sdkVersion) { + if (!sdkVersion || sdkVersion?.includes('next')) { await this.installPackage(packageManager, '@xata.io/client@next'); return; } else if (!sdkVersion?.includes('next')) {