“Laravel DB Droptabelle” Code-Antworten

Laravel Migration Rollback

To rollback one step:

php artisan migrate:rollback

To rollback multiple steps:

php artisan migrate:rollback --step=[x]
  
To drop all tables and reload all migrations:

php artisan migrate:fresh
Angry Albatross

PHP Artisan Droptabelle

php artisan make:migration drop_name_table
Super Starling

Laravel DB Droptabelle

//Get all the table names
$all_table_names = Schema::getConnection()->getDoctrineSchemaManager()->listTableNames();

foreach ($all_table_names as $name) {
    //if you don't want to truncate migrations in Database
    if ($name == 'migrations') {
        continue;
    }
    DB::table($name)->truncate();
}
Innocent Ibis

Migration des Laravel -Droptabelle

Schema::drop('users');

Schema::dropIfExists('users');
Alberto Peripolli

Laravel DB Droptabelle

foreach(\DB::select('SHOW TABLES') as $table) {
    $all_table_names = get_object_vars($table);
    \Schema::drop($all_table_names[key($all_table_names)]);
}
Innocent Ibis

Ähnliche Antworten wie “Laravel DB Droptabelle”

Fragen ähnlich wie “Laravel DB Droptabelle”

Weitere verwandte Antworten zu “Laravel DB Droptabelle” auf PHP

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen