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:
@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user