Rename column

This commit is contained in:
PovilasKorop
2021-11-09 11:05:49 +02:00
parent 57f6333ea3
commit 0140f00c32
4 changed files with 81 additions and 0 deletions
@@ -0,0 +1,32 @@
<?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()
{
Schema::create('companies', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('companies');
}
}
@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class RenameNameInCompaniesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// TASK: write the migration to rename the column "title" into "name"
Schema::table('companies', function (Blueprint $table) {
// Write code here
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('companies', function (Blueprint $table) {
//
});
}
}