39 lines
1.0 KiB
PHP
39 lines
1.0 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('penjualan', function (Blueprint $table) {
|
|
$table->id();
|
|
|
|
$table->string('nomor_penjualan')->unique();
|
|
$table->timestamp('waktu')->useCurrent();
|
|
$table->unsignedBigInteger('subtotal');
|
|
$table->unsignedBigInteger('diskon')->default(0);
|
|
$table->unsignedBigInteger('pajak')->default(0);
|
|
$table->unsignedBigInteger('total');
|
|
$table->string('metode_pembayaran');
|
|
$table->unsignedBigInteger('jumlah_bayar');
|
|
$table->unsignedBigInteger('kembalian')->default(0);
|
|
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('penjualan');
|
|
}
|
|
};
|