diff --git a/README.md b/README.md index 424409e..eaa84ab 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,34 @@ This command will generate a up and down migration in `db_migrations` DB Migrations are applied upon server start, but as well, it can be applied manually through: ```sh ./scripts/migration.sh {--down or --up} {number_of_times} -./scripts/migration.sh -d 1 -./scripts/migration.sh -u 1 ``` +### Usage + +#### Apply Migrations + +- To apply all migrations: + ```sh + ./scripts/migration.sh --up + ``` + +- To apply a specific number of migrations: + ```sh + ./scripts/migration.sh --up 2 + ``` + +#### Rollback Migrations + +- To roll back a specific number of migrations: + ```sh + ./scripts/migration.sh --down 2 + ``` + +- To roll back all migrations: + ```sh + ./scripts/migration.sh --down --all + ``` + ## Running Tests Install Mockery with ``` diff --git a/scripts/migration.sh b/scripts/migration.sh index bc836b3..0a782a9 100755 --- a/scripts/migration.sh +++ b/scripts/migration.sh @@ -36,7 +36,7 @@ case $key in DOWN_MIGRATION_NUMBER="$2" shift else - echo "Error: Down migration requires a specific number of migrations or -all flag to revert all migrations." + echo "Error: Down migration requires a specific number of migrations or --all flag to revert all migrations." exit 1 fi shift # past argument