web-dinda-private/database/migrations/2025_04_28_003550_create_ba...

32 lines
747 B
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('barangs', function (Blueprint $table) {
$table->id();
$table->string('nama_barang')->collation('utf8mb4_unicode_ci')->unique();
$table->integer('qty')->nullable();
$table->date('exp')->nullable();
$table->integer('harga');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('barang');
}
};