asyncmigrate-cli

Crates.ioasyncmigrate-cli
lib.rsasyncmigrate-cli
version0.2.0
sourcesrc
created_at2020-08-17 15:06:03.194435
updated_at2022-06-25 04:58:26.648683
descriptiondatabase migration with async support
homepagehttps://github.com/informationsea/asyncmigrate-rs
repositoryhttps://github.com/informationsea/asyncmigrate-rs
max_upload_size
id277544
size47,380
Yasunobu Okamura (informationsea)

documentation

README

asyncmigrate-cli

Command line tool for asyncmigrate

Configuration file example

{
    "database_url": "postgres://USER:PASSWORD@HOST:PORT/DBNAME",
    "changesets": [
        {
            "group_name": "default",
            "directory": "schema"
        }
    ]
}

directory path must be absolute path or relative to config file path.

SQL file name rule

Name of SQL files must be follow a rule in below.

VERSION__NAME.sql

VERSION must be a simple number and not include dot.

Usage

setup

initialize asyncmigrate config file

asyncmigrate-cli setup

migration

Apply new SQL files

asyncmigrate-cli migrate -c config.json default

rollback

Downgrade database schema. Asyncmigrate uses SQL commands written in a database to run downgrade. If you want to update downgrade SQLs, run update-rollback-sql command first.

asyncmigrate-cli rollback -c config.json default

update-rollback-sql

Update downgrade SQL without rollback or migration.

asyncmigrate-cli update-rollback-sql -c config.json default
Commit count: 5

cargo fmt