47 lines
1.1 KiB
PHP
47 lines
1.1 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('servicios', function (Blueprint $table) {
|
|
$table->id();
|
|
|
|
$table -> string('nombre')->nullable();
|
|
$table -> string('descripcion')->nullable();
|
|
$table -> string('color_fondo')->nullable();
|
|
$table -> string('estado')->nullable();
|
|
$table -> string('img')->nullable();
|
|
|
|
$table->unsignedBigInteger('promocion_id')->nullable();
|
|
|
|
$table->foreign('promocion_id')
|
|
->references('id')
|
|
->on('promociones')
|
|
->onDelete('cascade')
|
|
->onUpdate('cascade');
|
|
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('servicios');
|
|
}
|
|
};
|