php artisan make:migration change_sometable_in_finance_table --table=finance
public function up()
{
Schema::table('sometable', function (Blueprint $table) {
$table->text('text')->change();
});
}
Schema::table('users', function (Blueprint $table) {
$table->string('name', 50)->nullable()->change();
});
public function up()
{
// !!
//if error => Unknown database type enum requested
// add this line
Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
Schema::table('building', function (Blueprint $table) {
$table->float('height' , 10, 2)->change();
});
}
//don't forget reverse
public function down()
{
Schema::table('building', function (Blueprint $table) {
$table->bigInteger('epaisseur')->change();
});
}
public function up()
{
Schema::table('sometable', function (Blueprint $table) {
$table->text('text')->change();
});
}
$table-><column_type>('<column_name>')->change();