39 lines
1.0 KiB
PHP
39 lines
1.0 KiB
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
|
||
|
class CreateReceiptsTable extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('receipts', function (Blueprint $table) {
|
||
|
$table->bigIncrements('id');
|
||
|
$table->dateTime('payment_date');
|
||
|
$table->decimal('payment_amount', 8, 2);
|
||
|
$table->bigInteger('user_id')->unsigned();
|
||
|
$table->bigInteger('store_id')->unsigned();
|
||
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||
|
$table->foreign('store_id')->references('id')->on('stores')->onDelete('cascade');
|
||
|
$table->timestamps();
|
||
|
$table->engine = 'InnoDB';
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::dropIfExists('receipts');
|
||
|
}
|
||
|
}
|