pai-sklep/database/migrations/2021_10_28_093227_create_images_table.php
2021-12-05 22:01:53 +01:00

33 lines
763 B
PHP

<?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;
$table->foreignUuid("product_uuid")->nullable()->references("uuid")->on("products")->nullOnDelete();
$table->string('path')->unique();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('images');
}
}