Skip to content

Instantly share code, notes, and snippets.

@marksparrish
Last active November 8, 2021 15:52
Show Gist options
  • Save marksparrish/28c02540572b80935437d0cc3bd1606b to your computer and use it in GitHub Desktop.
Save marksparrish/28c02540572b80935437d0cc3bd1606b to your computer and use it in GitHub Desktop.
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateOrderProductTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('order_product', function (Blueprint $table) {
$table->integer('order_id')->index();
$table->integer('product_id')->index();
$table->integer('quantity')->nullable();
$table->integer('price')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('order_product');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment