php artisan migrate:fresh
php artisan migrate:fresh --seed
use IlluminateDatabaseSchemaBlueprint;
use IlluminateSupportFacadesSchema;
Schema::table('flights', function (Blueprint $table) {
$table->softDeletes();
});
Schema::table('flights', function (Blueprint $table) {
$table->dropSoftDeletes();
});
Class RemoveCommentViewCount extends Migration
{
public function up()
{
Schema::table('table', function($table) {
$table->dropColumn('coulmn_name');
});
}
public function down()
{
Schema::table('table', function($table) {
$table->integer('column_name');
});
}
}
Schema::drop('users');
Schema::dropIfExists('users');
// delete a migration safely from laravel
delete migration from database/migrations/ directory
and also delete entry from migrations table
Comment::where('post_id',$id)->delete();
// in down migration
public function down()
{
Schema::table('package_types', function (Blueprint $table) {
AppModelsPackageType::query()->where('id','gt',1)->delete();
});
}