public function actionFresh(RequestApplicationInterface $app)
    {
        if (\Reaction::isProd()) {
            $this->stdout("App env is set to 'production'.\nRefreshing migrations is not possible on production systems.\n");
            return resolve(true);
        }

        $confirmMessage = "Are you sure you want to reset the database and start the migration from the beginning?\nAll data will be lost irreversibly!";
        return $this->confirm($confirmMessage)->then(
            function() {
                return $this->truncateDatabase();
            },
            function() {
                $this->stdout('Action was cancelled by user. Nothing has been performed.');
                return resolve(true);
            }
        )->then(
            function() use ($app) {
                return $this->actionUp($app);
            }
        );
    }
public function actionFresh(RequestApplicationInterface $app)
    {
        if (\Reaction::isProd()) {
            $this->stdout("App env is set to 'production'.\nRefreshing migrations is not possible on production systems.\n");
            return resolve(true);
        }

        $confirmMessage = "Are you sure you want to reset the database and start the migration from the beginning?\nAll data will be lost irreversibly!";
        return $this->confirm($confirmMessage)->then(
            function() {
                return $this->truncateDatabase();
            },
            function() {
                $this->stdout('Action was cancelled by user. Nothing has been performed.');
                return resolve(true);
            }
        )->then(
            function() use ($app) {
                return $this->actionUp($app);
            }
        );
    }
public function actionFresh ( RequestApplicationInterface $ app ) { if ( \ Reaction :: isProd ( ) ) { $ this -> stdout ( "App env is set to 'production'.\nRefreshing migrations is not possible on production systems.\n" ) ; return resolve ( true ) ; } $ confirmMessage = "Are you sure you want to reset the database and start the migration from the beginning?\nAll data will be lost irreversibly!" ; return $ this -> confirm ( $ confirmMessage ) -> then ( function ( ) { return $ this -> truncateDatabase ( ) ; } , function ( ) { $ this -> stdout ( 'Action was cancelled by user. Nothing has been performed.' ) ; return resolve ( true ) ; } ) -> then ( function ( ) use ( $ app ) { return $ this -> actionUp ( $ app ) ; } ) ; }
Truncates the whole database and starts the migration from the beginning.

```
console migrate/fresh
```

@param RequestApplicationInterface $app
@return ExtendedPromiseInterface
Truncates the whole database and starts the migration from the beginning .