sani haq 3a5707b1bb
Added a .gitignore file for migration folder (#1334)
* added .gitignore file

* add .gitignore

* only add .gitignore if not in a existing git repo

* Use `git2` to detect git repository

---------

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2023-03-23 11:41:13 +08:00
..
2022-12-16 15:52:00 +08:00
2022-07-14 17:45:36 +08:00

Running Migrator CLI

  • Generate a new migration file
    cargo run -- migrate generate MIGRATION_NAME
    
  • Apply all pending migrations
    cargo run
    
    cargo run -- up
    
  • Apply first 10 pending migrations
    cargo run -- up -n 10
    
  • Rollback last applied migrations
    cargo run -- down
    
  • Rollback last 10 applied migrations
    cargo run -- down -n 10
    
  • Drop all tables from the database, then reapply all migrations
    cargo run -- fresh
    
  • Rollback all applied migrations, then reapply all migrations
    cargo run -- refresh
    
  • Rollback all applied migrations
    cargo run -- reset
    
  • Check the status of all migrations
    cargo run -- status