Skip to content

Commit

Permalink
fix: database creation for plugins should happen with the default pg …
Browse files Browse the repository at this point in the history
…pool
  • Loading branch information
Tethik committed Nov 26, 2024
1 parent fd462d0 commit 1259c32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/data/Migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export class Migration {
async migrate(dal: DataAccessLayer) {
const host = await config.postgres.host.getValue();
const databaseName = await getDatabaseName(this.pluginSuffix);

await this.ensureDbExists(dal.pool._pool, databaseName);

const pool = this.pluginSuffix
? await dal.pluginPool(this.pluginSuffix)
: dal.pool._pool;
Expand All @@ -36,8 +39,6 @@ export class Migration {
`Starting migration for ${process.env.NODE_ENV} (${host} - ${databaseName})`
);

await this.ensureDbExists(pool, databaseName);

const migrationConfig: MigrateDBConfig = { client: pool };

const migs = await postgresMigrate(migrationConfig, this.folderPath);
Expand Down

0 comments on commit 1259c32

Please sign in to comment.