diff --git a/package-lock.json b/package-lock.json index 5ea40c0..e72b2ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@athenna/database", - "version": "4.47.0", + "version": "4.48.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/database", - "version": "4.47.0", + "version": "4.48.0", "license": "MIT", "dependencies": { "@faker-js/faker": "^8.4.0", diff --git a/package.json b/package.json index e67954c..538a509 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/database", - "version": "4.47.0", + "version": "4.48.0", "description": "The Athenna database handler for SQL/NoSQL.", "license": "MIT", "author": "João Lenon ", diff --git a/src/commands/DbFreshCommand.ts b/src/commands/DbFreshCommand.ts index d3adbfa..963c0c6 100644 --- a/src/commands/DbFreshCommand.ts +++ b/src/commands/DbFreshCommand.ts @@ -35,6 +35,7 @@ export class DbWipeCommand extends BaseCommand { public async handle(): Promise { await Artisan.call(`db:wipe --connection ${this.connection}`) console.log() + await Artisan.call(`migration:run --connection ${this.connection}`) if (this.withSeeders) { diff --git a/src/commands/DbWipeCommand.ts b/src/commands/DbWipeCommand.ts index cb10d79..926ec59 100644 --- a/src/commands/DbWipeCommand.ts +++ b/src/commands/DbWipeCommand.ts @@ -36,15 +36,19 @@ export class DbWipeCommand extends BaseCommand { if (this.getConfig('driver') === 'mongo') { const tables = await DB.getTables() - await Exec.concurrently(tables, table => DB.dropTable(table)) + task.addPromise('Dropping all database tables', () => { + return Exec.concurrently(tables, table => DB.dropTable(table)) + }) } else { const migrationsTable = this.getConfig( 'migrations.tableName', 'migrations' ) - await DB.revertMigrations() - await DB.dropTable(migrationsTable) + task.addPromise('Reverting migrations', () => DB.revertMigrations()) + task.addPromise('Drop migrations table', () => + DB.dropTable(migrationsTable) + ) } const dbName = await DB.getCurrentDatabase()