@loomcore/api 0.1.94 → 0.1.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@ export declare class MigrationRunner {
|
|
|
6
6
|
private migrationsDir;
|
|
7
7
|
private primaryTimezone;
|
|
8
8
|
private dbConnection;
|
|
9
|
-
constructor(dbMigrationConfig: IInitialDbMigrationConfig
|
|
9
|
+
constructor(dbMigrationConfig: IInitialDbMigrationConfig);
|
|
10
10
|
private getTimestamp;
|
|
11
11
|
private parseSql;
|
|
12
12
|
private getMigrator;
|
|
@@ -14,7 +14,7 @@ export class MigrationRunner {
|
|
|
14
14
|
migrationsDir;
|
|
15
15
|
primaryTimezone;
|
|
16
16
|
dbConnection;
|
|
17
|
-
constructor(dbMigrationConfig
|
|
17
|
+
constructor(dbMigrationConfig) {
|
|
18
18
|
this.dbMigrationConfig = dbMigrationConfig;
|
|
19
19
|
this.dbType = dbMigrationConfig.app.dbType;
|
|
20
20
|
this.dbUrl = this.dbType === 'postgres' ? buildPostgresUrl(dbMigrationConfig) : buildMongoUrl(dbMigrationConfig);
|
|
@@ -3,6 +3,7 @@ import { getPostgresInitialSchema } from '../postgres-initial-schema.js';
|
|
|
3
3
|
import { getPostgresTestSchema } from '../../../../__tests__/postgres-test-migrations/postgres-test-schema.js';
|
|
4
4
|
export async function runInitialSchemaMigrations(pool, config) {
|
|
5
5
|
const migrationConfig = {
|
|
6
|
+
env: config.env || 'dev',
|
|
6
7
|
app: config.app,
|
|
7
8
|
database: config.database,
|
|
8
9
|
adminUser: config.adminUser ?? { email: 'admin@test.com', password: 'admin-password' },
|
|
@@ -2,6 +2,7 @@ import { IAppConfig } from "./app-config.interface.js";
|
|
|
2
2
|
import { IDatabaseConfig } from "./database-config.interface.js";
|
|
3
3
|
import { IEmailConfig } from "./email-config.interface.js";
|
|
4
4
|
export interface IInitialDbMigrationConfig {
|
|
5
|
+
env: string;
|
|
5
6
|
app: IAppConfig;
|
|
6
7
|
database: IDatabaseConfig;
|
|
7
8
|
adminUser: {
|