49 lines
1.3 KiB
PHP
49 lines
1.3 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
class AlterMaterialsTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::table('materials', function (Blueprint $table) {
|
|
$table->dropColumn('duration');
|
|
$table->dropForeign(['category_id']);
|
|
$table->dropColumn('category_id');
|
|
// $table->unsignedDecimal('duration')->nullable();
|
|
//
|
|
});
|
|
Schema::table('materials', function (Blueprint $table) {
|
|
// $table->dropColumn('duration');
|
|
$table->unsignedDecimal('duration')->nullable();
|
|
//
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::table('materials', function (Blueprint $table) {
|
|
//
|
|
$table->dropColumn('duration');
|
|
// $table->unsignedInteger('duration')->nullable();
|
|
});
|
|
Schema::table('materials', function (Blueprint $table) {
|
|
//
|
|
// $table->dropColumn('duration');
|
|
$table->unsignedInteger('duration')->nullable();
|
|
});
|
|
}
|
|
}
|