<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSamayajewelryDiamondsTable extends Migration
{
    public function up()
    {
        Schema::create('tbl_samayajewelry_diamond', function (Blueprint $table) {
            $table->id(); // Auto-incrementing ID
            $table->string('code')->nullable(); 
            $table->string('setcode')->nullable(); 
            $table->string('certificate_no')->nullable();
            $table->date('certificate_date')->nullable();
            $table->string('companycode')->nullable();
            $table->string('inventorylocationcode')->nullable();
            $table->string('description')->nullable();
            $table->string('shapecode')->nullable();
            $table->string('colorcode')->nullable();
            $table->string('claritycode')->nullable();
            $table->string('clarity_status')->nullable();
            $table->string('clarity_enhanced')->nullable();
            $table->decimal('weight', 8, 2)->nullable(); // Assuming 1.01 for weight
            $table->string('labcode')->nullable();
            $table->string('cutgrade')->nullable();
            $table->string('sizecode')->nullable();
            $table->string('lwd')->nullable();
            $table->decimal('length', 5, 2)->nullable(); 
            $table->decimal('width', 5, 2)->nullable(); 
            $table->decimal('depth', 5, 2)->nullable();
            $table->decimal('depth_pct1', 5, 2)->nullable();
            $table->decimal('table_pct', 5, 2)->nullable();
            $table->string('girdle')->nullable();
            $table->string('girdle_condition')->nullable();
            $table->decimal('girdle_pct', 5, 2)->nullable();
            $table->string('facet')->nullable();
            $table->string('culet')->nullable();
            $table->string('polish')->nullable();
            $table->string('polish_features')->nullable();
            $table->string('symmetry')->nullable();
            $table->string('symmetry_features')->nullable();
            $table->string('fluorescence')->nullable();
            $table->string('fluorescence_color')->nullable();
            $table->string('grain')->nullable();
            $table->string('angles')->nullable();
            $table->string('carbon')->nullable();
            $table->decimal('crown_angle', 5, 2)->nullable();
            $table->decimal('crown_height', 5, 2)->nullable();
            $table->decimal('pavilion_angle', 5, 2)->nullable();
            $table->decimal('pavilion_depth', 5, 2)->nullable();
            $table->decimal('star_length', 5, 2)->nullable();
            $table->decimal('lower_half', 5, 2)->nullable();
            $table->string('painting')->nullable();
            $table->string('proportion')->nullable();
            $table->string('synthetic')->nullable();
            $table->string('inscription')->nullable();
            $table->string('fancy_color')->nullable();
            $table->string('fancy_color_intensity')->nullable();
            $table->string('fancy_color_overtone')->nullable();
            $table->string('shade')->nullable();
            $table->string('eyeclean')->nullable();
            $table->string('bgm')->nullable();
            $table->string('center_inclusion')->nullable();
            $table->string('black_inclusion')->nullable();
            $table->string('hpht')->nullable();
            $table->string('irradiated')->nullable();
            $table->string('laser_drilled')->nullable();
            $table->decimal('cost', 8, 2)->nullable();
            $table->decimal('rapprice', 8, 2)->nullable();
            $table->decimal('markup1', 8, 2)->nullable();
            $table->decimal('price1', 8, 2)->nullable();
            $table->decimal('simplexdiam_price1', 8, 2)->nullable();
            $table->decimal('markup2', 8, 2)->nullable();
            $table->decimal('price2', 8, 2)->nullable();
            $table->decimal('markup3', 8, 2)->nullable();
            $table->decimal('price3', 8, 2)->nullable();
            $table->string('origin')->nullable();
            $table->string('brand')->nullable();
            $table->string('sarine')->nullable();
            $table->string('sarine_link')->nullable();
            $table->string('certificate_notes')->nullable();
            $table->string('other_notes')->nullable();
            $table->string('type')->nullable();
            $table->string('category')->nullable();
            $table->string('salespersoncode')->nullable();
            $table->string('vendoritem')->nullable();
            $table->string('vendorname')->nullable();
            $table->date('startdate')->nullable();
            $table->string('website')->nullable();
            $table->string('video_link')->nullable();
            $table->string('threed_link')->nullable();
            $table->string('notes')->nullable();
            $table->decimal('onhandweight', 8, 2)->nullable();
            $table->decimal('ownedweight', 8, 2)->nullable();
            $table->decimal('historyweight', 8, 2)->nullable();
            $table->decimal('holdweight', 8, 2)->nullable();
            $table->string('holdinfo')->nullable();
            $table->decimal('memooutweight', 8, 2)->nullable();
            $table->string('memooutinfo')->nullable();
            $table->decimal('memoinweight', 8, 2)->nullable();
            $table->decimal('orderweight', 8, 2)->nullable();
            $table->decimal('backorderedweight', 8, 2)->nullable();
            $table->decimal('poweight', 8, 2)->nullable();
            $table->decimal('injobsweight', 8, 2)->nullable();
            $table->timestamps(); // Automatically adds created_at and updated_at
        });
    }

    public function down()
    {
        Schema::dropIfExists('tbl_samayajewelry_diamond');
    }
}

//ALTER TABLE tbl_samayajewelry_diamond MODIFY COLUMN notes VARCHAR(1000);
