Task 7 - automatic column value

This commit is contained in:
PovilasKorop
2021-11-09 10:53:43 +02:00
parent 888d5d87c2
commit 76504ffe87
3 changed files with 51 additions and 0 deletions
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCompaniesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// TASK: edit this migration so that if company is created without the name
// its automatic value of name would be "My company"
Schema::create('companies', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('companies');
}
}