Files
portal-api/database/migrations/2024_01_31_155621_order.php
T
2025-07-24 16:18:27 +07:00

47 lines
1.3 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.
*
* @return void
*/
public function up()
{
//
Schema::create('order', function (Blueprint $table) {
$table->id();
$table->string('order_num', 255)->unique()->nullable();
$table->bigInteger('customer_id')->default(0)->index();
$table->integer('date')->nullable();
$table->integer('user_id')->default(0);
$table->integer('discount_id')->default(0);
$table->integer('invoice_id')->default(0);
$table->integer('discount_value')->nullable();
$table->integer('amount')->nullable();
$table->text('note')->nullable();
$table->string('client_ip', 100)->nullable();
$table->tinyInteger('status')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::table('order', function (Blueprint $table) {
$table->dropForeign(['customer_id', 'discount_id']);
$table->drop();
});
}
};