osb/database/migrations/0051-create_site_details.php

37 lines
705 B
PHP

<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('site_details', function (Blueprint $table)
{
$table->string('key');
$table->string('value');
$table->integer('site_id')->unsigned();
$table->foreign('site_id')->references('id')->on('sites');
$table->unique(['site_id','key']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('site_details');
}
};