feature/modelos-y-migraciones #3

Merged
rho merged 28 commits from feature/modelos-y-migraciones into master 2024-03-14 16:34:44 -03:00
2 changed files with 6 additions and 28 deletions
Showing only changes of commit b4c9c5b14e - Show all commits

View File

@ -13,7 +13,13 @@ public function up(): void
{
Schema::create('productos', function (Blueprint $table) {
$table->id();
$table->string('name', 100);
$table->double('price', 15, 2);
$table->unsignedBigInteger('categoria_id');
$table->boolean('solidario');
$table->boolean('bono');
$table->timestamps();
$table->foreign('categoria_id')->references('id')->on('categorias');
});
}

View File

@ -1,28 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('productos', function (Blueprint $table) {
$table->unsignedBigInteger('categoria_id')->after('id');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('productos', function (Blueprint $table) {
$table->dropColumn('categoria_id');
});
}
};