Crates.io | asyncmigrate-cli |
lib.rs | asyncmigrate-cli |
version | 0.2.0 |
source | src |
created_at | 2020-08-17 15:06:03.194435 |
updated_at | 2022-06-25 04:58:26.648683 |
description | database migration with async support |
homepage | https://github.com/informationsea/asyncmigrate-rs |
repository | https://github.com/informationsea/asyncmigrate-rs |
max_upload_size | |
id | 277544 |
size | 47,380 |
Command line tool for asyncmigrate
{
"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.
Name of SQL files must be follow a rule in below.
VERSION__NAME.sql
VERSION
must be a simple number and not include dot.
initialize asyncmigrate config file
asyncmigrate-cli setup
Apply new SQL files
asyncmigrate-cli migrate -c config.json default
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 downgrade SQL without rollback or migration.
asyncmigrate-cli update-rollback-sql -c config.json default