intento
This commit is contained in:
@@ -13,13 +13,11 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('sales', function (Blueprint $table) {
|
||||
$table->id();
|
||||
// 1. Cliente que compra
|
||||
$table->foreignId('user_id')->constrained()->onDelete('cascade');
|
||||
// 2. Datos generales de la venta
|
||||
$table->decimal('total', 10, 2); // Total final del ticket
|
||||
$table->string('metodo_pago'); // Ej: "Efectivo", "Tarjeta", "MercadoPago"
|
||||
//capaz van mas datos ni idea
|
||||
// 3. Fecha y Hora (created_at servirá como fecha de venta)
|
||||
//$table->foreignId('user_id')->constrained();
|
||||
// nullable para que no sea obligatrio
|
||||
$table->foreignId('client_id')->nullable()->constrained();
|
||||
$table->decimal('total', 10, 2);
|
||||
$table->string('payment_method');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user