Created
May 10, 2020 17:38
-
-
Save parzibyte/6b63366c87f3dc3be7b52f5d5a778fe4 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\Support\Facades\Schema; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CrearFotosDeArticulos extends Migration | |
{ | |
/** | |
* Run the migrations. | |
* | |
* @return void | |
*/ | |
public function up() | |
{ | |
Schema::create('fotos_articulos', function (Blueprint $table) { | |
$table->increments('id'); | |
$table->timestamps(); | |
$table->string("ruta", 255); | |
$table->unsignedInteger("articulos_id"); | |
$table->foreign("articulos_id") | |
->references("id") | |
->on("articulos") | |
->onDelete("cascade") | |
->onUpdate("cascade"); | |
}); | |
} | |
/** | |
* Reverse the migrations. | |
* | |
* @return void | |
*/ | |
public function down() | |
{ | |
Schema::dropIfExists('fotos_articulos'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment