Axinom Mosaic Libraries
    Preparing search index...

    Function getBeforeMigrationScripts

    • Retrieves an array of relative string paths to before-migration SQL scripts, consumed by graphile-migrate settings. Scripts contain helper functions added to the ax_utils and ax_define schemas.

      Parameters

      • OptionalmigrationsFolder: string

        Absolute path to the consuming project's migrations folder. Defaults to <cwd>/migrations.

      • OptionalbeforeMigrationScriptsPath: string

        Absolute path to this package's migrations/before-migration directory. Optional override for callers that want to resolve the package assets themselves.

        When omitted, the package root is resolved internally in both the CJS and ESM builds and the bundled migrations/before-migration directory is used.

        Callers that need the explicit path can use getDbCommonBeforeMigrationPath:

        import { getBeforeMigrationScripts, getDbCommonBeforeMigrationPath } from '@axinom/mosaic-db-common';

        await getBeforeMigrationScripts(
        migrationsFolder,
        getDbCommonBeforeMigrationPath(import.meta.url),
        );

      Returns Promise<string[]>