Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 16, 2020 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/89fd7367c9674587a21c3c9edb0fd45f to your computer and use it in GitHub Desktop.
Save parzibyte/89fd7367c9674587a21c3c9edb0fd45f to your computer and use it in GitHub Desktop.
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
class ChangeProductDescriptionDatatype extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('products', function (Blueprint $table) {
DB::statement("ALTER TABLE products MODIFY description LONGTEXT");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('products', function (Blueprint $table) {
DB::statement("ALTER TABLE products MODIFY description VARCHAR(255)");
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment