Agregada columna y campo cantidad_ollas
This commit is contained in:
parent
60c327f74b
commit
200c38cb29
2 changed files with 41 additions and 1 deletions
|
@ -12,7 +12,15 @@ use App\Filtros\FiltroDeSubpedido;
|
||||||
|
|
||||||
class Subpedido extends Model
|
class Subpedido extends Model
|
||||||
{
|
{
|
||||||
protected $fillable = ['grupo_de_compra_id', 'aprobado', 'nombre', 'devoluciones_total', 'devoluciones_notas', 'tipo_pedido_id'];
|
protected $fillable = [
|
||||||
|
'grupo_de_compra_id',
|
||||||
|
'aprobado',
|
||||||
|
'nombre',
|
||||||
|
'devoluciones_total',
|
||||||
|
'devoluciones_notas',
|
||||||
|
'tipo_pedido_id',
|
||||||
|
'cantidad_ollas'
|
||||||
|
];
|
||||||
|
|
||||||
public function productos(): BelongsToMany
|
public function productos(): BelongsToMany
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Subpedido;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class CantidadOllasPedidos extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('subpedidos', function (Blueprint $table) {
|
||||||
|
$table->integer('cantidad_ollas')->nullable();
|
||||||
|
});
|
||||||
|
Subpedido::where('tipo_pedido', 1)->update(['cantidad_ollas' => 0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue