File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,22 @@ pub async fn apply_migrations(db: &Database) -> anyhow::Result<()> {
5353 let migrator = Migrator :: new ( migrations_dir)
5454 . await
5555 . with_context ( || migration_err ( "preparing the database migration" ) ) ?;
56+ if migrator. migrations . is_empty ( ) {
57+ log:: info!( "No migration found. \
58+ You can specify database operations to apply when the server first starts by creating files \
59+ in {MIGRATIONS_DIR}/<VERSION>_<DESCRIPTION>.sql \
60+ where <VERSION> is a number and <DESCRIPTION> is a short string.") ;
61+ return Ok ( ( ) ) ;
62+ }
63+ log:: info!( "Found {} migrations:" , migrator. migrations. len( ) ) ;
64+ for m in migrator. iter ( ) {
65+ log:: info!(
66+ "\t [{:04}] {:?} {}" ,
67+ m. version,
68+ m. migration_type,
69+ m. description
70+ ) ;
71+ }
5672 migrator
5773 . run ( & db. connection )
5874 . await
You can’t perform that action at this time.
0 commit comments