2021-11-14 14:51:49 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
class CreateImagesTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('images', function (Blueprint $table) {
|
|
|
|
$table->uuid("uuid")->unique()->primary;
|
2021-11-14 20:44:10 +01:00
|
|
|
$table->foreignUuid("product_uuid")->references("uuid")->on("products");
|
2021-11-14 14:51:49 +01:00
|
|
|
$table->string('path')->unique();
|
|
|
|
$table->timestamps();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('images');
|
|
|
|
}
|
|
|
|
}
|