Apply PostgreSQL migrations
Version updated for yakubique/postgresql-apply-migrations to version v1.1.
- This action is used across all versions by ? repositories.
Go to the GitHub Marketplace to find the latest changes.
Release notes
Apply PostgreSQL migrations
Automatically applies SQL migrations to your database.
Supports PostgreSQL 9.4+
Action uses thomwright/postgres-migrations
A PostgreSQL migration library inspired by the Stack Overflow system described in Nick Craver’s blog.
Migrations are defined in sequential SQL files, for example:
migrations
├ 1_create-table.sql
├ 2_alter-table.sql
└ 3_add-index.sql
Usage
- name: Apply PostgreSQL migrations
uses: yakubique/postgresql-apply-migrations@v1.1
with:
migrations: './.github/migrations'
host: ${{ env.PG_HOST }}
username: ${{ env.PG_USER }}
password: ${{ env.PG_PWD }}
Inputs
INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
---|---|---|---|---|
migrations | string | true | Path to migrations folder | |
host | string | true | PostgreSQL host | |
username | string | true | PostgreSQL username | |
password | string | true | PostgreSQL password | |
db | string | true | "postgres" | PostgreSQL database |
port | string | true | "5432" | PostgreSQL port (default: 5432) |
ssl | string | false | "true" | SSL enabled (default: ’true') |
to_file | string | false | "false" | Save migration results to file |
Outputs
OUTPUT | TYPE | DESCRIPTION |
---|---|---|
migrations | string | Applied migrations list (or path to result if to_file=true ) |