Create migration in console:
php artisan make:migration add_mycolumn_to_mytable
BashUse Schema::table() to access existing table (instead of Schema::create() for creating new tables)
public function up()
{
Schema::table('mytable', function($table) {
$table->text('mycolumn');
});
}
public function down()
{
Schema::table('mytable', function($table) {
$table->dropColumn('mycolumn');
});
}
PHPThen run migrations:
php artisan migrate
Bash
Leave a Reply