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

34 lines
735 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-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');
}
}