pai-sklep/database/migrations/2021_12_14_153612_add_cart_...

39 lines
930 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddCartItemQuantity extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cart_items', function (Blueprint $table) {
$table->unsignedInteger("quantity")->default(1);
});
Schema::table('orderProduct', function (Blueprint $table) {
$table->unsignedInteger("quantity")->default(1);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cart_items', function (Blueprint $table) {
$table->dropColumn("quantity");
});
Schema::table('orderProduct', function (Blueprint $table) {
$table->dropColumn("quantity");
});
}
}