“Migración de la tabla de caída de Laravel” Código de respuesta

Laravel cae todas las tablas

php artisan migrate:fresh

php artisan migrate:fresh --seed
Foolish Ferret

php artisan make:migration drop_name_table
Super Starling

 Class RemoveCommentViewCount extends Migration
  {
      public function up()
      {
          Schema::table('articles', function($table) {
             $table->dropColumn('comment_count');
             $table->dropColumn('view_count');
          });
      }

      public function down()
      {
          Schema::table('articles', function($table) {
             $table->integer('comment_count');
             $table->integer('view_count');
          });
      }
  }
Lazy Book

Update Table

migrate:fresh          Drop all tables and re-run all migrations
migrate:install        Create the migration repository
migrate:refresh        Reset and re-run all migrations
migrate:reset          Rollback all database migrations
migrate:rollback       Rollback the last database migration
migrate:status         Show the status of each migration

for specific table
php artisan migrate:refresh --path=/database/migrations/table_name.php
Engineer Wajid Ali

Schema::drop('users');

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

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

Respuestas similares a “Migración de la tabla de caída de Laravel”

Preguntas similares a “Migración de la tabla de caída de Laravel”

Más respuestas relacionadas con “Migración de la tabla de caída de Laravel” en PHP

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código