add column
move from old column to new column
drop column
rename column
how to remove cloumn with new migration file
how to craete
public function up(): void
{
Schema::table('settings_site', function (Blueprint $table) {
$table->string('retailer_signatory')->nullable();
});
Schema::table('delivery_locations', function (Blueprint $table) {
$table->dropColumn('test');
});
} write down method for this
what is down method for this
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateSiteSettingsAndDeliveryLocations extends Migration
{
public function up()
{
Schema::table('settings_site', function (Blueprint $table) {
$table->string('retailer_signatory')->nullable();
});
Schema::table('delivery_locations', function (Blueprint $table) {
$table->dropColumn('test');
});
}
public function down()
{
Schema::table('settings_site', function (Blueprint $table) {
$table->dropColumn('retailer_signatory');
});
Schema::table('delivery_locations', function (Blueprint $table) {
$table->string('test')->nullable();
});
}
}
====================
$table->string('retailer_signatory')->nullable()->change();
what is the down method fo rthis
$table->string('retailer_signatory')->nullable()->change();
$table->string('retailer_signatory')->nullable(false)->change();
==
No comments:
Post a Comment