Workspace seeders with version (#10895)

# Introduction
close https://github.com/twentyhq/core-team-issues/issues/487
Updated the seeders to infer the workspace's version from the
`APP_VERSION` env var

To test in local run: `npx nx database:reset twenty-server` with either
a defined or not defined `APP_VERSION` in your `.env`
( note that invalid semver values will throw an error and stop the
process ) ( valid version ex: `APP_VERSION=1.0.0`)
This commit is contained in:
Paul Rastoin
2025-03-17 15:32:49 +01:00
committed by GitHub
parent 3e3e8de400
commit 8b5d5b35ad
5 changed files with 86 additions and 63 deletions

View File

@ -95,8 +95,14 @@ export class DataSeedWorkspaceCommand extends CommandRunner {
await rawDataSource.initialize();
const isBillingEnabled = this.environmentService.get('IS_BILLING_ENABLED');
const appVersion = this.environmentService.get('APP_VERSION');
await seedCoreSchema(rawDataSource, workspaceId, isBillingEnabled);
await seedCoreSchema({
workspaceDataSource: rawDataSource,
workspaceId,
seedBilling: isBillingEnabled,
appVersion,
});
await rawDataSource.destroy();