Schema::create('tbl_mst_mesin', function (Blueprint $table) { $table->id(); $table->string("nama_mesin"); $table->unsignedBigInteger('gedung_id'); $table->unsignedBigInteger('kategori_mesin_id'); $table->enum('isactive', [0, 1])->default(1); //1=active,0=not active $table->timestamp('created_at')->useCurrent(); $table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate(); $table->string('user_create')->nullable(); $table->string('user_update')->nullable(); $table->foreign('gedung_id')->references('id')->on('mst_gedung'); $table->foreign('kategori_mesin_id')->references('id')->on('tbl_mst_kategori_mesin')->onDelete('cascade'); }); create_tbl_mst_mesin Schema::create('tbl_mst_parameter', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('mesin_id'); $table->string('nama_parameter'); $table->enum('isactive', [0, 1])->default(1); //1=active,0=not active $table->timestamp('created_at')->useCurrent(); $table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate(); $table->string('user_create')->nullable(); $table->string('user_update')->nullable(); $table->foreign('mesin_id')->references('id')->on('tbl_mst_mesin')->onDelete('cascade'); }); create_tbl_mst_parameter Schema::create('tbl_trs_parameter_h', function (Blueprint $table) { $table->id(); $table->date('tanggal'); $table->unsignedBigInteger('operator_id'); $table->string('shift'); $table->string('shift_grup'); $table->unsignedBigInteger('mesin_id'); $table->enum('isactive', [0, 1])->default(1); //1=active,0=not active $table->timestamp('created_at')->useCurrent(); $table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate(); $table->string('user_create')->nullable(); $table->string('user_update')->nullable(); $table->foreign('operator_id')->references('id')->on('tbl_mst_operator')->onDelete('cascade'); $table->foreign('mesin_id')->references('id')->on('tbl_mst_mesin')->onDelete('cascade'); }); create_tbl_trs_parameter_h $table->id(); $table->unsignedBigInteger('mesin_id'); $table->string('nama_parameter'); $table->string('unit'); $table->enum('isactive', [0, 1])->default(1); //1=active,0=not active $table->timestamp('created_at')->useCurrent(); $table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate(); $table->string('user_create')->nullable(); $table->string('user_update')->nullable(); $table->foreign('mesin_id')->references('id')->on('tbl_mst_mesin')->onDelete('cascade'); create_tbl_mst_parameter Schema::create('tbl_mst_parameter', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('mesin_id'); $table->string('nama_parameter'); $table->string('unit')->nullable(); $table->enum('isactive', [0, 1])->default(1); //1=active,0=not active $table->timestamp('created_at')->useCurrent(); $table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate(); $table->string('user_create')->nullable(); $table->string('user_update')->nullable(); $table->foreign('mesin_id')->references('id')->on('tbl_mst_mesin')->onDelete('cascade'); }); create_tbl_mst_parameter Schema::create('tbl_trs_parameter_operator_h', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('header_id'); $table->unsignedBigInteger('operator_id'); $table->enum('isactive', [0, 1])->default(1); //1=active,0=not active $table->timestamp('created_at')->useCurrent(); $table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate(); $table->string('user_create')->nullable(); $table->string('user_update')->nullable(); $table->foreign('header_id')->references('id')->on('tbl_trs_parameter_h')->onDelete('cascade'); $table->foreign('operator_id')->references('id')->on('tbl_mst_operator')->onDelete('cascade'); }); create_tbl_trs_parameter_operator_h Schema::create('tbl_trs_parameter_h', function (Blueprint $table) { $table->id(); $table->date('tanggal'); $table->unsignedBigInteger('operator_id'); $table->string('shift'); $table->string('shift_grup'); $table->unsignedBigInteger('mesin_id'); $table->enum('isactive', [0, 1])->default(1); //1=active,0=not active $table->timestamp('created_at')->useCurrent(); $table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate(); $table->string('user_create')->nullable(); $table->string('user_update')->nullable(); $table->foreign('operator_id')->references('id')->on('tbl_mst_operator')->onDelete('cascade'); $table->foreign('mesin_id')->references('id')->on('tbl_mst_mesin')->onDelete('cascade'); create_tbl_trs_parameter_h Schema::create('tbl_trs_parameter_d', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('header_id'); $table->unsignedBigInteger('parameter_id'); $table->unsignedBigInteger('jenis_kategori_mesin_id'); $table->string('value_parameter'); $table->enum('isactive', [0, 1])->default(1); //1=active,0=not active $table->timestamp('created_at')->useCurrent(); $table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate(); $table->string('user_create')->nullable(); $table->string('user_update')->nullable(); $table->foreign('header_id')->references('id')->on('tbl_trs_parameter_h')->onDelete('cascade'); $table->foreign('parameter_id')->references('id')->on('tbl_mst_parameter')->onDelete('cascade'); $table->foreign('jenis_kategori_mesin_id')->references('id')->on('tbl_mst_mesin')->onDelete('cascade'); }); Schema::create('tbl_trs_parameter_operator_h', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('header_id'); $table->unsignedBigInteger('operator_id'); $table->enum('isactive', [0, 1])->default(1); //1=active,0=not active $table->timestamp('created_at')->useCurrent(); $table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate(); $table->string('user_create')->nullable(); $table->string('user_update')->nullable(); $table->foreign('header_id')->references('id')->on('tbl_trs_parameter_h')->onDelete('cascade'); $table->foreign('operator_id')->references('id')->on('tbl_mst_operator')->onDelete('cascade'); }); create_tbl_trs_parameter_d