Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
database

GitHub Action

Migrate database

v0.2.0

Migrate database

database

Migrate database

Database seed tool built with golang-migrate

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Migrate database

uses: VoVaVc/[email protected]

Learn more about this action in VoVaVc/migrate-github-action

Choose a version

Migrate for GitHub Actions

A wrapper for golang-migrate cli.

Input variables

See action.yml for more detailed information.

  • path - relative path to your migration folder
  • database - a command to connect to the database
  • command - migrate cli command to run
  • prefetch - Number of migrations to load in advance before executing (default 10)
  • lockTimeout - Allow N seconds to acquire database lock (default 15)
  • verbose - Print verbose logging
  • version - Print version

Migrate CLI docs

Usage

name: run migration
on: [push]
jobs:

  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
        name: Checkout
        uses: actions/checkout@v3
      - name: Migrate
        uses: vovavc/[email protected]
        with:
            path: ./backend/migrate
            database: postgres://username:password@localhost:5432/database_name?sslmode=disable
            command: up

Contributing

Pull requests are welcome at VoVaVc/migrate-github-action

License

The scripts and documentation in this project are released under the MIT License