Created
August 1, 2021 06:27
-
-
Save cursosdesarrolloweb/5512ff3d1b9f22bd1ae02e88e58cb0ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Database\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Support\Facades\Schema; | |
class CreateProjectsTable extends Migration | |
{ | |
/** | |
* Run the migrations. | |
* | |
* @return void | |
*/ | |
public function up() | |
{ | |
Schema::create('projects', function (Blueprint $table) { | |
$table->id(); | |
$table->foreignId("user_id")->constrained(); | |
$table->string("name", 100)->unique(); | |
$table->text("description")->nullable(); | |
$table->string("featured_image", 150)->nullable(); | |
$table->timestamps(); | |
}); | |
} | |
/** | |
* Reverse the migrations. | |
* | |
* @return void | |
*/ | |
public function down() | |
{ | |
Schema::dropIfExists('projects'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment