npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nestjs-mod/pg-flyway

v1.3.0

Published

PgFlyway - utility for working with database migrations (site: https://www.npmjs.com/package/pg-flyway, preview version only for Postgres)

Readme

@nestjs-mod/pg-flyway

PgFlyway - utility for working with database migrations (site: https://www.npmjs.com/package/pg-flyway, preview version only for Postgres)

NPM version monthly downloads Telegram Discord

Installation

npm i --save-dev [email protected]
npm i --save @nestjs-mod/pg-flyway

Modules

| Link | Category | Description | | ---- | -------- | ----------- | | PgFlyway | infrastructure | PgFlyway - utility for working with database migrations (site: https://www.npmjs.com/package/pg-flyway, preview version only for Postgres) |

Modules descriptions

PgFlyway

PgFlyway - utility for working with database migrations (site: https://www.npmjs.com/package/pg-flyway, preview version only for Postgres)

Use in NestJS-mod

An example you can see the full example here https://github.com/nestjs-mod/nestjs-mod-contrib/tree/master/apps/example-prisma-pg-flyway.

import { PACKAGE_JSON_FILE, ProjectUtils, bootstrapNestApplication } from '@nestjs-mod/common';
import { DOCKER_COMPOSE_FILE, DockerCompose, DockerComposePostgreSQL } from '@nestjs-mod/docker-compose';
import { PgFlyway } from '@nestjs-mod/pg-flyway';
import { join } from 'path';

export const pgflywayPrismaFeatureName = 'pg-flyway-prisma';

const rootFolder = join(__dirname, '..', '..', '..');
const appFolder = join(rootFolder, 'apps', 'example-prisma-pg-flyway');

bootstrapNestApplication({
  modules: {
    system: [
      ProjectUtils.forRoot({
        staticConfiguration: {
          applicationPackageJsonFile: join(appFolder, PACKAGE_JSON_FILE),
          packageJsonFile: join(rootFolder, PACKAGE_JSON_FILE),
          envFile: join(rootFolder, '.env'),
        },
      }),
    ],
    infrastructure: [
      DockerCompose.forRoot({
        configuration: {
          dockerComposeFileVersion: '3',
          dockerComposeFile: join(appFolder, DOCKER_COMPOSE_FILE),
        },
      }),
      DockerComposePostgreSQL.forRoot(),
      DockerComposePostgreSQL.forFeature({
        featureModuleName: pgflywayPrismaFeatureName,
      }),
      PgFlyway.forRoot({
        staticConfiguration: {
          featureName: pgflywayPrismaFeatureName,
          migrationsFolder: join(appFolder, 'src', 'migrations'),
        },
      }),
    ],
  },
});

After connecting the module to the application and npm run build and starting generation of documentation through npm run docs:infrastructure, you will have new files and scripts to run.

New scripts mostly package.json

{
  "scripts": {
    "_____pg-flyway_____": "_____pg-flyway_____",
    "pg-flyway:create:example-prisma-pg-flyway": "./node_modules/.bin/nx run example-prisma-pg-flyway:pg-flyway-create-migration",
    "pg-flyway:migrate:example-prisma-pg-flyway": "./node_modules/.bin/nx run example-prisma-pg-flyway:pg-flyway-migrate"
  },
  "scriptsComments": {
    "pg-flyway:create:example-prisma-pg-flyway": [
      "Command to create new empty migration for example-prisma-pg-flyway, for set name pass name to --args, example: npm run pg-flyway:create:appname --args=Init"
    ],
    "pg-flyway:migrate:example-prisma-pg-flyway": ["Applying migrations for example-prisma-pg-flyway"]
  }
}

Additional commands in the nx application project.json

{
  "targets": {
    "pg-flyway-create-migration": {
      "executor": "nx:run-commands",
      "options": {
        "commands": [
          "export PG_FLYWAY_DATABASE_URL=${EXAMPLE_PRISMA_PG_FLYWAY_PG_FLYWAY_PRISMA_DATABASE_URL} && export PG_FLYWAY_HISTORY_TABLE=__migrations_example_prisma_pg_flyway && export PG_FLYWAY_LOCATIONS=./apps/example-prisma-pg-flyway/src/migrations && ./node_modules/.bin/pg-flyway create --name=${npm_config_args:-NewMigration}"
        ],
        "parallel": false,
        "envFile": "./.env",
        "color": true
      }
    },
    "pg-flyway-migrate": {
      "executor": "nx:run-commands",
      "options": {
        "commands": [
          "export PG_FLYWAY_DATABASE_URL=${EXAMPLE_PRISMA_PG_FLYWAY_PG_FLYWAY_PRISMA_DATABASE_URL} && export PG_FLYWAY_HISTORY_TABLE=__migrations_example_prisma_pg_flyway && export PG_FLYWAY_LOCATIONS=./apps/example-prisma-pg-flyway/src/migrations && ./node_modules/.bin/pg-flyway migrate"
        ],
        "parallel": false,
        "envFile": "./.env",
        "color": true
      }
    },
    "pg-flyway-info": {
      "executor": "nx:run-commands",
      "options": {
        "commands": [
          "export PG_FLYWAY_DATABASE_URL=${EXAMPLE_PRISMA_PG_FLYWAY_PG_FLYWAY_PRISMA_DATABASE_URL} && export PG_FLYWAY_HISTORY_TABLE=__migrations_example_prisma_pg_flyway && export PG_FLYWAY_LOCATIONS=./apps/example-prisma-pg-flyway/src/migrations && ./node_modules/.bin/pg-flyway info"
        ],
        "parallel": false,
        "envFile": "./.env",
        "color": true
      }
    },
    "pg-flyway-baseline": {
      "executor": "nx:run-commands",
      "options": {
        "commands": [
          "export PG_FLYWAY_DATABASE_URL=${EXAMPLE_PRISMA_PG_FLYWAY_PG_FLYWAY_PRISMA_DATABASE_URL} && export PG_FLYWAY_HISTORY_TABLE=__migrations_example_prisma_pg_flyway && export PG_FLYWAY_LOCATIONS=./apps/example-prisma-pg-flyway/src/migrations && ./node_modules/.bin/pg-flyway baseline"
        ],
        "parallel": false,
        "envFile": "./.env",
        "color": true
      }
    },
    "pg-flyway-validate": {
      "executor": "nx:run-commands",
      "options": {
        "commands": [
          "export PG_FLYWAY_DATABASE_URL=${EXAMPLE_PRISMA_PG_FLYWAY_PG_FLYWAY_PRISMA_DATABASE_URL} && export PG_FLYWAY_HISTORY_TABLE=__migrations_example_prisma_pg_flyway && export PG_FLYWAY_LOCATIONS=./apps/example-prisma-pg-flyway/src/migrations && ./node_modules/.bin/pg-flyway validate"
        ],
        "parallel": false,
        "envFile": "./.env",
        "color": true
      }
    },
    "pg-flyway-repair": {
      "executor": "nx:run-commands",
      "options": {
        "commands": [
          "export PG_FLYWAY_DATABASE_URL=${EXAMPLE_PRISMA_PG_FLYWAY_PG_FLYWAY_PRISMA_DATABASE_URL} && export PG_FLYWAY_HISTORY_TABLE=__migrations_example_prisma_pg_flyway && export PG_FLYWAY_LOCATIONS=./apps/example-prisma-pg-flyway/src/migrations && ./node_modules/.bin/pg-flyway repair"
        ],
        "parallel": false,
        "envFile": "./.env",
        "color": true
      }
    }
  }
}

Environments

| Key | Description | Sources | Constraints | Default | Value | | ------ | ----------- | ------- | ----------- | ------- | ----- | |databaseUrl|Connection string for database with credentials (example: postgres://feat:feat_password@localhost:5432/feat?schema=public)|obj['databaseUrl'], process.env['DATABASE_URL']|isNotEmpty (databaseUrl should not be empty)|-|-|

Static configuration

| Key | Description | Constraints | Default | Value | | ------ | ----------- | ----------- | ------- | ----- | |featureName|PgFlyway feature name for generate prefix to environments keys|optional|-|-| |migrationsFolder|Folder with migrations|isNotEmpty (migrationsFolder should not be empty)|-|-| |pgFlywayHistoryTable|Table with history of migrations|optional|-|-| |nxProjectJsonFile|Application or library project.json-file (nx)|optional|-|-|

Back to Top

Links

  • https://github.com/nestjs-mod/nestjs-mod - A collection of utilities for unifying NestJS applications and modules
  • https://github.com/nestjs-mod/nestjs-mod-contrib - Contrib repository for the NestJS-mod
  • https://github.com/nestjs-mod/nestjs-mod-example - Example application built with @nestjs-mod/schematics
  • https://github.com/nestjs-mod/nestjs-mod/blob/master/apps/example-basic/INFRASTRUCTURE.MD - A simple example of infrastructure documentation.
  • https://github.com/nestjs-mod/nestjs-mod-contrib/blob/master/apps/example-prisma/INFRASTRUCTURE.MD - An extended example of infrastructure documentation with a docker-compose file and a data base.
  • https://dev.to/endykaufman/collection-of-nestjs-mod-utilities-for-unifying-applications-and-modules-on-nestjs-5256 - Article about the project NestJS-mod
  • https://habr.com/ru/articles/788916 - Коллекция утилит NestJS-mod для унификации приложений и модулей на NestJS

License

MIT