pai-sklep/database/migrations/2021_10_28_093227_create_images_table.php

34 lines
763 B
PHP
Raw Normal View History

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-12-05 22:01:53 +01:00
$table->foreignUuid("product_uuid")->nullable()->references("uuid")->on("products")->nullOnDelete();
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');
}
}