purityselect/database/migrations/2024_01_25_220746_create_carts_table.php
2024-10-25 01:05:27 +05:00

57 lines
1.7 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('carts', function (Blueprint $table) {
$table->id();
$table->string('first_name')->nullable();
$table->string('last_name')->nullable();
$table->string('email')->nullable();
$table->string('phone')->nullable();
$table->date('date_of_birth')->nullable();
$table->string('shipping_address1')->nullable();
$table->string('shipping_address2')->nullable();
$table->string('shipping_city')->nullable();
$table->string('shipping_state')->nullable();
$table->string('shipping_zipcode')->nullable();
$table->string('shipping_country')->nullable();
$table->string('billing_address1')->nullable();
$table->string('billing_address2')->nullable();
$table->string('billing_city')->nullable();
$table->string('billing_state')->nullable();
$table->string('billing_zipcode')->nullable();
$table->string('billing_country')->nullable();
$table->decimal('shipping_amount', 8, 2)->default(0);
$table->decimal('total_amount', 8, 2);
$table->timestamps();
$table->unsignedBigInteger('patient_id')->nullable();
$table->foreign('patient_id')->references('id')->on('patients');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('carts');
}
};