MIELICIUS / database / migrations / 2023_01_03_141034_create_bahans_table.php
2023_01_03_141034_create_bahans_table.php
Raw
<?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('bahans', function (Blueprint $table) {
            $table->id('idbahan');
            $table->string('kodebahan')->unique();
            $table->string('namabahan');
            $table->integer('hargabahan');
            $table->float('stockbahan');
            $table->string('satuanbahan');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('bahans');
    }
};