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

49 lines
1.4 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('invoice', function (Blueprint $table) {
$table->id();
$table->string('order_num', 255)->unique()->nullable();
$table->integer('date')->nullable();
$table->integer('due_date')->nullable();
$table->integer('date_paid')->nullable();
$table->integer('sub_total')->nullable();
$table->integer('tax')->nullable();
$table->integer('total')->nullable();
$table->bigInteger('customer_id')->default(0)->index();
$table->integer('order_id')->default(0)->index();
$table->text('note')->nullable();
$table->string('client_ip', 100)->nullable();
$table->string('vm_id')->nullable()->index();
$table->tinyInteger('invoice_type')->default(1);
$table->tinyInteger('status')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('invoice', function (Blueprint $table) {
$table->dropForeign(['payment_id', 'customer_id']);
$table->drop();
});
}
};