Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cursosdesarrolloweb/5512ff3d1b9f22bd1ae02e88e58cb0ea to your computer and use it in GitHub Desktop.
Save cursosdesarrolloweb/5512ff3d1b9f22bd1ae02e88e58cb0ea to your computer and use it in GitHub Desktop.
<?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