Files
sirpremiumv2/database/migrations/2022_10_22_204343_create_promociones_table.php
T
2023-11-07 22:43:10 +00:00

45 lines
1.1 KiB
PHP
Executable File

<?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('promociones', function (Blueprint $table) {
$table->id();
$table -> string('precio')->nullable();
$table -> string('img_publicidad')->nullable();
$table -> string('fecha_limite')->nullable();
$table -> string('visible')->nullable();
$table->unsignedBigInteger('categoria_id')->nullable();
$table->foreign('categoria_id')
->references('id')
->on('categorias')
->onDelete('cascade')
->onUpdate('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('promociones');
}
};