Skip to content

Flyway

The Flyway lexicon provides typed constructors for Flyway v10+ TOML configuration files. It covers projects, environments, resolvers, provisioners, placeholders, callbacks, and database-specific settings.

Install it with:

Terminal window
npm install --save-dev @intentius/chant-lexicon-flyway
import { FlywayProject, FlywayConfig, Environment } from "@intentius/chant-lexicon-flyway";
export const project = new FlywayProject({
id: "my-project",
name: "my-project",
databaseType: "postgresql",
});
export const config = new FlywayConfig({
locations: ["filesystem:sql/migrations"],
defaultSchema: "public",
encoding: "UTF-8",
validateMigrationNaming: true,
cleanDisabled: true,
});
export const dev = new Environment({
url: "jdbc:postgresql://localhost:5432/devdb",
user: "dev_user",
password: "dev_pass",
schemas: ["public"],
displayName: "dev",
});

The lexicon provides 5 resource types (FlywayProject, FlywayConfig, Environment, FlywayDesktopConfig, RedgateCompareConfig), 20 property types (resolvers, provisioners, database configs), and composites (StandardProject, MultiEnvironmentProject, VaultSecuredProject, DesktopProject, environmentGroup) for common patterns.

chant includes lint rules for Flyway config. For example:

  • Hardcoded credentials in environment configs
  • Production environments with clean enabled
  • Missing schema definitions
  • Unresolved resolver references
  • Invalid callback event names

See Lint Rules for the full list.

MetricCount
Resources5
Property types20
Services2
Intrinsic functions3
Pseudo-parameters8
Lint rules20

Lexicon version: 0.0.22
Namespace: Flyway